15,190 Topics
![]() | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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. | |
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 … | |
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. | |
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 … | |
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 … | |
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> … | |
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 … | |
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>', … | |
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 == … | |
What this produces and why? >>> a = 2 >>> b = 5 >>> exec "print(a+b)" in dict(a=6, b=9) | |
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 … | |
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 … | |
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 | |
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 … | |
![]() | 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, … ![]() |
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 = … | |
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 … | |
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 … | |
![]() | 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! |
![]() | 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 … ![]() |
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 … | |
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. | |
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 … | |
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 … |
The End.