15,175 Topics
| |
Hi all, I'm trying to read data from this xml file that looks like this: <VEGETABLE > < FRUIT > <FRUIT name="apple">1</FRUIT> <FRUIT name="Orange">2</FRUIT> <FRUIT name="Benana">6</FRUIT> I wrote the following script:[CODE]import sys from xml.dom.minidom import parse from cmath import sqrt # Load XML into tree structure tree = parse(sys.stdin) #Find … | |
I am trying to implement this code for hash table in python and i don't understand why i and k are not used in the while loop. Can somebody help me please, [CODE] import random data = [] m = 10 t = [] for i in range(10): data.append(random.randint(0, 100)) … | |
I"m trying to determine if the user is root or not then prompt to become root user; [CODE]if os.geteuid() != 0: # If not root user... os.system("gksudo crack.py") # Open root password window else: # Do Nothing if os.geteuid() == 0: # If you are root user... os.system("You are now … | |
Hello, my task is to create a basic game using Pygame. I decided to do the basic snake game like the one that was on all of the old mobile phones. However when inputing some of the basic code, i realised that once i have paused my game i have … | |
I have to creat a program that draws squares instead of circles. It also has to draw additional squares for each mouse click, and at the end print a message "Click again to quit" after the loop, and wait for a final clikc before closing the window. This is what … | |
I am trying to only have the words print out if they occur the same number of times as in the fibonacci sequence. If a words show up 1,2,3,5,8 etc then it will print up. I have gotten the program to print up the words based on how many times … | |
Greetings all! Anyway excuse my English. I can't understand how I can do this: <loop cycle; variable is filled by some values> <loop is still running, but simultaneously another command is running> <loop is terminated; i want to read variable> More specifically (it concerned with Scapy module, but I'll explain … | |
For some reason it just jumps to the else statement instead of going to if and elif. Any input would really be apreciated. [CODE]a=raw_input( "What is your name: ") b= int(raw_input( "What year were you born: ")) c= int(raw_input( "What year is it now: ")) print "Hello",a,"you are",c-b,"years old." class … | |
I have stated to make a program called virtual Tv, I have been having troubles with variabels and I need the variable: state to be able to be change and accessed outside the class and inside, but I think that state is a local variable at the moment. [CODE]import random … | |
I want to limit the size of a list control box. Let us take the following code: [code] import wx class Students(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(380, 230)) hbox = wx.BoxSizer(wx.HORIZONTAL) panel = wx.Panel(self, -1) self.list = wx.ListCtrl(panel, -1, style=wx.LC_REPORT) self.list.InsertColumn(0, 'name') self.list.InsertColumn(1, 'age') hbox.Add(self.list, … | |
Hello. I have been trying to run a simple script in Windows 7 DOS using the python command, but it returns this error message: 'python' is not recognized as an internal or external command, operable program, or batch file. I've looked up how to fix on Google, but I can't … | |
For this program I am trying to figure out how to sort/print the words out based on frequency of appearance in ascending order. As of now I can only get the words to sort/print based on alaphabetical order [CODE] from collections import Counter import string while True: filename=raw_input('Enter a file … | |
Hi guys, thanks for all the help lately, but I require some more :o I need it that the user is able to choose what is on the controller, when I type in a valid option I test for it that it gets to that point but it does not … | |
I need to know how to copy some folders not all from a source tmp/folder. I'm new to python and I want to better understand python. I can't use copytree because I don't wish to copy all folders. I want to be able to pick the folders I want to … | |
I'm looking for a simple way to rotate a shape in python, tkinter. The shape I'm rotating is a triangle (polygon) if it matters. Thanks in advance for all the help | |
Hi! i'm doing a final project for a university introduction course in web programmation. I'v Coded this: [CODE]class MainHandler(BaseHandler): def get(self): #product_comments = Comments().get_all() user = users.get_current_user() if user: member = Members().get_by_id(user.user_id()) baskets=Baskets().get_by_member(member) template_args = {'baskets': baskets} products = Products().get_all() product_comments = [] for product in products: comments = Comments().get_by_product(product) … | |
Hey All, I have written a script that uses elementTree to work on python 2.4. Took quite a while and worked a threat but now I need to get it working on 2.3.4. I can't upgrade the version of python. Is there an equivelent version of the element tree for … | |
This is a simple word jumble game, I actually adapted it from one I used from practice. It's written in Python 3.1 using the pyscripter. NO modules needed. | |
I was just able to get PyQt4 to work on my system, and I'm now have that of python2.6, and that of python 3.2, but I have been trying to open Qt designer but all it does is just open a process in the background eating up my PCs memory, … | |
hi all ..... [CODE]for(i=0, i<680,i++): i =m [/CODE] wen i run a program it is showing error in for loop like wen i run a program it is showing error in for loop ..... | |
Using both the 2011 and 2010 Fuel Efficiency .csv files, recreate the script from class allowing the user to specify the lowest gas mileage they are willing to get, list the cars available from 2011 meeting the mileage criteria, list the cars available from 2010 that meet the mileage criteria, … | |
I found [URL="http://www.daniweb.com/software-development/cpp/threads/358674"]this assignment[/URL] on C++ forum as was browsing to see little where I am in my mostly C little C++ thrown in understanding of C++ and if I should try to increase my knowledge in that language. I could not believe my eyes! The OP is completely lost … | |
There is many more stupid things to do than to read words of one of the best if not the best: [URL="http://norvig.com/lispy2.html"](An ((Even Better) Lisp) Interpreter (in Python))[/URL] | |
Hi guys, I tried to run the configure.py in the pyQt folder using command prompt, but it kept coming back with an error that's looks something like this trace back import sipconfigure no module named sipconfigure what do I do now guys, how do I tackle this. | |
Hi I'm having a test suite in python and i would like to email the result through my company server. I used a similar code but the code seems to be hung while waiting for a response from server during socket.connect() call. I traced the code and found that it … | |
Whats up guys? This program has given me nightmares lol. When input is a positive integer, the program should reduce it to prime factors. The integer is less than 900. The program should Output the prime factors as a series that when multiplied together, will return the original integer. If … | |
Hi, how would I login to an HTTPS site? I used the following code to connect to the site, but how do I login? [CODE]import httplib HOSTNAME = 'login.yahoo.com' conn = httplib.HTTPSConnection(HOSTNAME) conn.putrequest('GET', '') conn.endheaders() response = conn.getresponse() print response.read() [/CODE] | |
One part of my program requires that the user enters a date and this date is then checked against each product in the dictionary to see if the date the product arrived plus its shelf life causes the product to expire before or after the date entered by the user. … | |
hi, The problem is that i have one list like [l1 l2 l3 l4 l5 l6 l7 l8 ] no i want to compare l1 with l2 and get some score then l1 with l3.... and then l1 with l3 , l4 , l5.......... so on when i am compareing … | |
Here is experiment of how VM and Swing UI manage the sort test posted previously, instead of CPython and Tkinter. The timing is not so sweet, but at least no Java required! [CODE]K:\jython2.5.2>java -jar jython.jar swing_test.py 256000 words generated in 10.93 s Sorted in 1.68 s List prepared in 22.71 … |
The End.