15,175 Topics
| |
I have set up a code in a class but i am not sure if this is the class that i would use.I have to put the logic of the game in a Class and then use the methods from the class to run the game.Right now i have some … | |
Hi, I m calling a url, which can be called using either GET or POST method. When I use @ symbol in url like /abc/@rushali it will not come in its get method. I printed something directly in class, it is showing there, but not in get method. I am … | |
Hi i have a python program project its to make an arithmetic program with difficulty lievels -essentially a calculator - that throws out addition, subtraction, multiplication, division and combined math problems (depending on which function the user chooses) -also has three difficulty levels. more digits are added when difficulty is … | |
How do I subtract or add in a lists? When I run the program below I get the message print int(pool-strength) TypeError: unsupported operand type(s) for -: 'list' and 'int' [code=python] # Character Development Dungeons and Dragons # pool are the total points that I can use. pool = [30] … | |
I use ctypes to play AUDIO using bass.dll found here: [url]http://www.un4seen.com/[/url] I have gone so far and tried as they advised me at their forum entry here: [url]http://www.un4seen.com/forum/?topic=9257.0[/url] But I still get errors. Can anyone take code and analyze to point out source of error? Here is the code, pse … | |
I have a simple Tkinter program that has a button and an entry. Now, how do I run code from the entry? For example: Entry -> print 'Hello!' Button -> Run the entry command | |
[B]delete a list in text file[/B] well i m having a text file which contain time,user name & id, now if i want to modify the time without affecting the id & user name is it possible? or how i delete that list & enter a new list in that … | |
Hi i have a python program project its to make an arithmetic program with difficulty levels -essentially a calculator - that throws out addition, subtraction, multiplication, division and combined math problems at random (depending on which function the user chooses) -also has three difficulty levels, which can be chosen by … | |
and i try use module random... >>> print random.randint(0,10) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'random' is not defined that's my version... Python 2.5.2 (r252:60911, Aug 1 2008, 00:37:21) [GCC 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]] on linux2 Type "help", "copyright", "credits" or … | |
Created a program random words with a list. When I run the program it will output duplicated items. How do I prevent that. Is there a special command to prevent that? [code=python]import random # random choice from a list for i in range(6): print random.choice (["abacus", "biology", "chemistry", "dog", elf", … | |
Hi, Im making a program that is sortove like a media player... well, it is a media player. Its quite basic at the moment but i have been working on a few features. One of the things it can do is that it can play a video full screen. I … | |
Do any of you know a function to play a playlist in PyGame? The music files on the playlist should be played one after the other in the order they occur. Any type of help would be appreciate it. | |
Hi Everyone, Does any one know of a way in Tkinter on Windows to imitate Tkinter.Menu behavior in that when you select an item in a widget, say a child window, that the parent window doesn't lose focus (title bar doesn't dim as it goes out of focus). For example, … | |
I have completed a script which opens various txt files within a folder path and does calculations on them, currently being set for example: path = "./folderfileshere" is there a simple solution to grab a folder path using a gui function similar to that of the browse for folder function … | |
Hi I"m fairly new to python and need some help with a slightly complicated programming solution. I'm trying to write a simply TCP sniffer (not a proxy!) that will sniff tcp packets coming from a specific IP and a specific port that is arriving to my local computer where the … | |
I want to create varibales as a1,a2,a3,...a10. For that i used a for loop.As the variable in loop increments..i need var gettng created as above . Can anyone give me an idea? At the same time of creation i need to be able to assign to them There i m … | |
Hi everyone! I am a beginner python user and have a final project due for the class. I am doing blackjack since it's my favorite card game. I am terrible at python but busted out code for the game itself. I was thinking of making it into a GUI, but … | |
:( I need to convert unicode strings in Python to other types such as unsigned and signed int 8 bits,unsigned and signed int 16 bits,unsigned and signed int 32 bits,unsigned and signed int 64 bits,double,float,string,unsigned and signed 8 bit,unsigned and signed 16 bit, unsigned and signed 32 bit,unsigned and signed … | |
what is the reason why Python doesn't have switch statement ? | |
Hi,am trying to search and extract the text [CODE]href="http://www.yahoo.com"[/CODE] from a string <a href="http://www.yahoo.com" id="link1">.Here is my code: [CODE=python] import re p=re.compile(r'\b(href="(.*)"){1}\b') m=p.search('<a href="live.net" link="go2">') print m.group() #Prints: href="live.net" link=" [/CODE] The code above [CODE]Prints: href="live.net" link="[/CODE],but i want to the href="live.net" I need help on this please | |
Hi, everyone. I'm trying to use gettext in complicate application. It consists of C++ code wrapped in python interface via sip. Is it possible to bind textdomain once in python code, and don't use this function in C++ code? Now I have to use this function twice like is shown … | |
I m using Python 2.5. The dll i imported is created using clr. The dll function is returning a string. I m trying to apply "partition" attribute to it. I m not able to do it. Even the partition is not working. I think "all stringd returned from clr are … | |
I have written a script that runs with a glade gui. When a button in glade is pushed I need it to run a piece of code, pause for 3 seconds and run it again in an on going loop until the button is pushed again. So the button is … | |
How do I use classes in python? Do I import them? For example: class classA: def __init__(self): print "class A" class classB: def __init__(self): classA_list = [] for i in range(5): classA_list.append(classA()) #list of classA objects This works if I have both classes in one file. But if the classes … | |
Hi guys.. Im stuck on my project and i urgently need ur help. i want to randomly generate some moving rectangles (one after another moving in the same direction). this should occur infinitely. So far i have only managed to create one moving rectangle. i hope u guys can help … | |
Hi, I am trying to login to a site which is a pretty standard process when using the ClientForm library. My problem is that when I login I am redirected to a site that says another user is logged in on the account and to click to continue and kick … | |
Hey, what does figure() and show() do? I have tried help in ipython, but I still don't understand other than my program sometimes stop when I don't use them. | |
Well, for the first time it seems I have stumbled onto a bug I have never been able to figure out with google. Application Type: wxPython 2.8.9.1 (Python 2.6 Version ANSI) Python 2.6 py2exe 0.6.9 Anyways, I compiled an application that uses wxPython. I then proceeded to run the application … | |
I'm learning ctypes right now and have made simple function and here is the code [CODE=python] #import ctypes module import ctypes as ct #get BOOL C++ value from ctypes from ctypes.wintypes import BOOL #Loading the DLL see: http://www.daniweb.com/forums/thread160430.html bass_dll = ct.cdll.bass #here is function description on the function """ Loads … | |
I recently wrote a program to determine perfect numbers..... [CODE]n=raw_input("Please input a number: ") factors = [] p=int(n) for k in range(1): x=0 while x < p-(p/3): x=x+1 z = p/x if p%z == 0: factors.append(z) if factors.count(z) > 1: factors.remove(z) print "The factors are,", factors print "the sum of … |
The End.