15,190 Topics

Member Avatar for
Member Avatar for werydude

Hello. I am a python noob asking a probably obvious question. I am making sort of a question game, although its still in the debugging stage. The problem is below. (Way below) #A simple game of common knowledge. #Dependecies import time start = "" lv1 = False lv2 = False …

Member Avatar for werydude
0
254
Member Avatar for ryan461

I've got an XML file that looks like this: <routingTable> <router> <id>1</id> <ip>1.1.1.1</ip> <nexthop>1.1.1.2</nexthop> </router> <router> <id>2</id> <ip>2.2.2.1</ip> <nexthop>2.2.2.2</nexthop> </router> </routingTable> With possibly more than two router entries as time goes on. What I would like to do, is take each router instance and throw it into a dictionary. This …

Member Avatar for ryan461
0
211
Member Avatar for shean1488

Hi everybody, Explain me please what I'm doing wrong. So I'm trying to create a database and store data, that I get from django forms. Everything looks fine, and when I manually check database it shows that it recieved a new row, however my browser gives me this message and …

Member Avatar for TrustyTony
0
4K
Member Avatar for smile1

I have the following code where I have several small problems. I have included some comments as I can't seem to get my 'pop up menu' button to work in order to retrieve the number of columns requested by the user. I then need to be able to get the …

Member Avatar for woooee
0
2K
Member Avatar for elyos

Hi guys! I start using Python few days ago, for a game server ( it'a an online game ). I made a server for that game, I start it on my pc, and for do this I need to start Server.py too, or, it wouldn't connect to the server. I …

Member Avatar for elyos
0
293
Member Avatar for mimobe

Hello everybody, I'm trying to improve an application i found at this link [Click Here](http://www.alcrypto.co.uk/satmap/tkinter-video.py) which can load and play a video file .avi or .ogg. My problem is as follows: I'm unable to load another video file though i have access to the dialog box. In addition to that, …

0
193
Member Avatar for skiabox

I have a group of files (A.txt, AA.txt etc) in the form A.txt : A,45,56,78,98,11,23 A,98,90,33,76,30,40 AA.txt : AA,65,76,34,76,98,12 AA,12,76,33,76,33,89 How can I quickly remove the symbol column (A,AA) from all these files using Python? (I want to use python because the number of txt files is 3200) Thank you.

Member Avatar for Gribouillis
0
174
Member Avatar for pythonstudent11

I am in course that uses Gaddis' Starting Out With Pyton 2nd Edition. There is a problem in the course that asks use to write a program that would capitalize sentences that a user inputs. I have come up with a reasonable solution, but I have two major problems. The …

Member Avatar for alexgwhiz69
0
5K
Member Avatar for rokkamraja

Hi, I know how to get the current active window in Python using PyWin32 api's . However, whenever I get the name of a particular window, I need to log the keystrokes in that window. How would I go about doing this ? Thanks, Raja.

0
55
Member Avatar for jancho1911

Hi!!! I am making a program that is supose to use Naive bayes classifier to classify text from few categories. This is the best i can do to explain, here is what i have done so far: import math d=open('D.txt', 'r') di=open('kat1.txt', 'r') posleden = di.readlines() total = d.readlines() Di …

Member Avatar for callmerudy
0
213
Member Avatar for prettyspinster

Hello, I am very new to python and have been going through all over the web to try to figure out my problem. I have small script that I would like to do something simple with. I have a number of files called soemthing like (myFile00.txt, myFile01.txt,...). Mainly this is …

Member Avatar for prettyspinster
0
121
Member Avatar for shean1488

Hi everybody, I'm trying to do a simple login for a web site, and everything looks fine except one thing, when I enter a name and a password for a superuser I got "403 Forbidden" error. here is my login.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> …

0
103
Member Avatar for prashanthmukund

I just came across this question. All the solutions given are in PERL for this question. I thought I can learn solving this in Python as I could learn many thing by solving this problem. But I am stuck. The question is: You are working at a grocery store which …

Member Avatar for TrustyTony
0
120
Member Avatar for G_S

Hello. I am working on a personal project. It's basically a program for changing specific tags from certain HTML files. So far, everything works. The GUI and the logic a work but I know the main function is wrong because it looks like this: def tag_remove(HTML_string): clean_HTML = a_string.replace('<b>', '').replace('<i>', …

Member Avatar for G_S
0
8K
Member Avatar for Frensi

Hello all, I'm very new to programming and Python so please forgive my ignorance. i'm just wondering if it's possible to have two strings on one elif. Something like this. name = input("What is your full name: ") if name == "Jack Neilson": print("I like your name") elif name == …

Member Avatar for TrustyTony
0
150
Member Avatar for TrustyTony

What this produces and why? >>> a = 2 >>> b = 5 >>> exec "print(a+b)" in dict(a=6, b=9)

Member Avatar for TrustyTony
1
183
Member Avatar for frivolous

hi, i made a music player it opens almost all the songs but while opening some songs it gives this error : A:/Chrome Downloads/Jhalla_Wallah_(Remix)_-_(MusicTub.Com).mp3 Error 277 for "open "A:Chrome DownloadsJhalla_Wallah_(Remix)_-_(MusicTub.Com).mp3" alias mp3_0.878022650438": A problem occurred in initializing MCI. Error 263 for "set mp3_0.878022650438 time format milliseconds": The specified device is …

Member Avatar for frivolous
0
5K
Member Avatar for zmjman08

Hi, I'm trying to take two text files, compare them, then output the matches into a new text file. I've read the thread started by the1last, but that's outputting differences, not matches. I just started learning about python a couple days ago, so I don't know anything about what syntax …

Member Avatar for santosh2430
0
14K
Member Avatar for HankReardon

Hello, Is there a Python tutor in this group who would be willing to help me with about 3 - lines of code. I have an assignment due on the 4th of July and am a little stuck. Thank You, HR

Member Avatar for TrustyTony
0
101
Member Avatar for HankReardon

Hello, I am having trouble writing a variable named UpperCaseSentence outside of a for loop in this particular code snippet. It runs fine while in the loop but not while out of the loop. Can anyone shed some light on this dilemma for me. Here is the code. Thank you …

Member Avatar for HankReardon
0
3K
Member Avatar for HTMLperson5

Is it possible to create a scripting language using Python? Interactive Shell is fine, just something which comes close to a scripting language? Which allows the user to script some sort of functionality? Maybe more that just a console like this: def main(): cmd = (raw_input('#>>')) if cmd=="do_stuff": print "Ok, …

Member Avatar for HTMLperson5
0
1K
Member Avatar for johndb

I have downloaded vpython and try to run one of the examples included with the program. [CODE]from visual import * floor = box(length=4, height=0.5, width=4, color=color.blue) ball = sphere(pos=(0,4,0), color=color.red) ball.velocity = vector(0,-1,0) dt = 0.01 while 1: rate(100) ball.pos = ball.pos + ball.velocity*dt if ball.y < 1: ball.velocity.y = …

Member Avatar for alex.avak
0
301
Member Avatar for vy_007

I have to write an application in python for image processing.I have made scripts of all the image editing options. Now I want to add GUI in it. I want a window where I can give the path of an image on which I want to perform the editing! At …

Member Avatar for TrustyTony
0
5K
Member Avatar for Acidz

Hi, People... I have a question about reading xls files in python then parsing it to sqlDatabase. The thing is, that the xls file(pricelist) we as a company use are ordered and it's pretty easy to sort that out. The problem comes with xls files from other companies. (We are …

Member Avatar for Acidz
0
355
Member Avatar for HTMLperson5

This is a program using the `urllib` module to find the (html/any client-side script) source code of any website which exists. Have fun!

Member Avatar for M.S.
0
169
Member Avatar for HTMLperson5

Hi guys, I am having a problem with the following code: #Health set here def win(): import time print "You win!" print "Thanks for playing" time.sleep(10) quit() def lose(): import time print "You lose!" print "Thanks for playing" time.sleep(10) quit() from random import randint pos_damage = randint(15,472) en_health = 1000 …

Member Avatar for HTMLperson5
0
271
Member Avatar for Testa

Hi all! Is my first post here and well, im very new with python (just aroun 10 days). I did the famous "Guess my number" game. (Python pick up a number and user must guess it). All right, i have not problems with this. But now im trying in the …

Member Avatar for Testa
0
213
Member Avatar for tarun123

hey if anyone knows how to open open window when we click on open option in menu bar of gui which is created by boa constructor.

0
158
Member Avatar for trishtren

Hey, Iv been looking around google for the past few days to find ways to embed python 3.2 into my c++ application. I however want interpeter to be compiled into my application, so i can merely distribute one exe file without relying on the user to install python. However the …

Member Avatar for TrustyTony
0
282
Member Avatar for efth

I recently left Python behind to pick up Java. In Python, a variable defined in a function could not be called outside of the function. But you could at least let the function return a value, which could be a variable defined in the function. When a variable is defined …

Member Avatar for jLocke
0
251

The End.