15,181 Topics
| |
Hello, I'm new to Python and I'm using Pydev. I'm having a problem: I have several classes and several variables outside the classes. I want to change a variable outside the classes from within a class: e.g. [code]# Class [B]class name_change(object): [COLOR="Green"]"""Change a text variable outside this class"""[/COLOR] def name_change(self): … | |
this a quick question, does it make diffrernece, on which version of python you have, would it still run, most of the codes. for example, if you made code, in pythion version 3, and then you copied the code, in to an older versions, would it still run. | |
Is there a lib in python which allows automation of keyboard sequences (for want of a better expression 'keyboard emulation') I'm pretty new to python, so please be easy on me if it's a [B][I]really[/I][/B] daft question. :P Thanks. | |
i have balckjack code, which does not run, i need some ones help, with tellings, wht the problem is. i have higlighted part of the code,were it stops. below is the code. [CODE]from random import choice as rc rc=randomcards def total(hand): # aces in the hand aces = hand.count(11) # … | |
Hi everyone I dont know if this question has already been answer but I really need help so bare with me. So here is my problem I just downloaded python 2.6 for windows however whenever i try to open the IDLE i get this message: IDLE can't bind TCP/IP port … | |
Hi everyone,i wrote a python thread that opens a file and reads it.The problem is that i dont know how to return the data as the thread will not return it from the run() method.I tried writing another function that gets the file content but when i call this function,it … | |
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 … |
The End.