15,181 Topics

Member Avatar for
Member Avatar for elvenstruggle

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): …

Member Avatar for elvenstruggle
0
114
Member Avatar for tutti

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.

Member Avatar for sneekula
0
73
Member Avatar for shr2408

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.

Member Avatar for shr2408
0
358
Member Avatar for tutti

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) # …

Member Avatar for tutti
0
111
Member Avatar for Zetlin

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 …

Member Avatar for mn_kthompson
0
358
Member Avatar for codedhands

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 …

Member Avatar for codedhands
0
2K
Member Avatar for aodpreacher

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 …

Member Avatar for tutti
0
1K
Member Avatar for rockrushali

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 …

Member Avatar for lllllIllIlllI
0
60
Member Avatar for cointosser

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 …

Member Avatar for mn_kthompson
0
92
Member Avatar for dseto200

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] …

Member Avatar for mn_kthompson
0
328
Member Avatar for Stefano Mtangoo

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 …

Member Avatar for Stefano Mtangoo
0
123
Member Avatar for MaracKoMarac

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

Member Avatar for MaracKoMarac
0
78
Member Avatar for nitinloml

[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 …

Member Avatar for woooee
0
199
Member Avatar for cointosser

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 …

Member Avatar for Murtan
0
117
Member Avatar for Hrothgar

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 …

Member Avatar for Stefano Mtangoo
0
171
Member Avatar for dseto200

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", …

Member Avatar for dseto200
0
84
Member Avatar for lllllIllIlllI

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 …

0
50
Member Avatar for leb

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.

Member Avatar for hupa_nguyendinh
0
186
Member Avatar for Trenholmes

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, …

0
43
Member Avatar for Crazywu

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 …

Member Avatar for Stefano Mtangoo
0
770
Member Avatar for bugmenot

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 …

0
76
Member Avatar for Rejinacm

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 …

Member Avatar for paddy3118
0
112
Member Avatar for sumzilla

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 …

Member Avatar for Stefano Mtangoo
0
353
Member Avatar for Rejinacm

:( 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 …

Member Avatar for sneekula
0
54
Member Avatar for Rejinacm
Member Avatar for sneekula
0
129
Member Avatar for codedhands

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

Member Avatar for jice
0
125
Member Avatar for Trmsk

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 …

Member Avatar for Trmsk
0
146
Member Avatar for Rejinacm

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 …

Member Avatar for Rejinacm
0
107
Member Avatar for muppet

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 …

0
67
Member Avatar for nuaris

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 …

Member Avatar for nuaris
0
149

The End.