15,190 Topics

Member Avatar for
Member Avatar for sneekula

I know that you can do integer calculation in Python with astronomically large numbers. What is the precision limit when using floats?

Member Avatar for vegaseat
0
162
Member Avatar for sneekula

I know you can get the present time this way: [code]import time now = time.asctime(time.localtime()) print now # Mon Feb 19 10:41:32 2007 [/code]How can I make sure that 'now' does not fall on our lunchtime break, let's say 11:30AM to 12:45PM?

Member Avatar for sneekula
0
158
Member Avatar for fonzali

hi , thanks for the code , I have changed it a little bit , I have also added two buttons (+,-) I have written the code for (+) but it does not work , can you tell me what the problem is , the last lines which are commented …

Member Avatar for sneekula
0
160
Member Avatar for aot

I've been having a lot of trouble with the [inlinecode]after[/inlinecode] method. What I want to do is show a series of images at the push of a button/press of a key -- each image should appear for 500ms, then be replaced by the next image, which should go on indefinitely …

Member Avatar for Ene Uran
0
112
Member Avatar for scru

I know I've been told before to use C++ sockets...and I will if this doesn't work out, but that was before I even knew python had sockets. Now. The problem here if that my socket enabled program seems to work perfectly well on a LAN, but not over the internet …

Member Avatar for scru
0
203
Member Avatar for Matt Tacular

I have an image being displayed in a Tkinter window. I need a way to add letters to the image in certain spots depending on what is done by the user. Example: if button 1 is pressed, the peoples names appear over their heads, but I can't just switch the …

Member Avatar for mawe
0
3K
Member Avatar for Acolyte

Hello, I have a simple script with 2 buttons positioned vertically within a sizer on a panel. A button-click event attached to the top button changes the height of the top button. However, even though the height of the top button changes, the height of the bottom button does not …

Member Avatar for Acolyte
0
87
Member Avatar for chris99

I am trying to follow the tutorial on making the whack-a-monkey game, but it keeps giving me this error message: [QUOTE] Traceback (most recent call last): File "C:/Documents and Settings/Christopher/My Documents/pygame/examples/examples/monkeystuff.py", line 128, in -toplevel- chimp = Chimp() File "C:/Documents and Settings/Christopher/My Documents/pygame/examples/examples/monkeystuff.py", line 66, in __init__ screen = pygame.display.get_suface() …

Member Avatar for bumsfeld
0
279
Member Avatar for muddpigeon

hey there, i have a piece of coursework to be handed in tomorow and i am struggling to get this new bit of code that has been issued right. i have to write the pseudocode for an atm machine and one of the procedures is to validate a pin number. …

Member Avatar for muddpigeon
0
82
Member Avatar for aot

Hi, I'm a noob Python/Tkinter user, and I'm finding that gathering information on the two is not as easy as I'd like... hopefully you guys will be able to help. My first question: I was just wondering if there's a way to tell Python, "take all the files in X …

Member Avatar for mawe
0
97
Member Avatar for scru

Hi. SInce you guys were so helpful the last time around, I decided to ask a less pressing, but more casual questions. My friends and I want to build a private p2p client (connects to our computers through this client to share files and do messaging), just for the heck …

Member Avatar for scru
0
107
Member Avatar for kharri5

Hello, I have a program written up that is trying to use buttons to turn on and off the radiobuttons themselves. IF the user clicks on the radiobutton itself, then it should have no affect. This simulates a sort of UI touch screen affect, with the radiobuttons themselves looking like …

0
58
Member Avatar for jrcagle

I'm re-creating the classic PacMan for the fun of it and needed a way to translate back and forth between directions and dx, dy for a sprite. Here was a fun solution that avoided cumbersome if...elif...elif...elif... chains. Any thoughts on readability, efficiency? Specifically, if this gets called by 4 monsters …

Member Avatar for jrcagle
0
95
Member Avatar for sneekula
Member Avatar for sneekula

This could be a cooking recipe, but in my case it is a chemical recipe. Here is a typical generic chemical recipe: 23 g chemicalA is dissolved in 250 ml methanol. The solution is cooled to 0 - 5 degC and 18 ml compoundB is added dropwise over 60 minutes. …

Member Avatar for jbennet
0
209
Member Avatar for chris99

[CODE] def classCreate(self): self.classChoose = Toplevel(root) self.classChoose.title('Choose your Class') self.classChoose.geometry('300x200+300+400') self.labelChoose = Label(self.classChoose, text="Select the class you wish to be") self.labelChoose.grid(row=0) self.listClass = Listbox(self.classChoose, height=4) self.listClass.grid(row=1) self.listClass.insert(END,"Warrior") self.listClass.insert(END,"Brute") self.confirm = Button(self.classChoose, text="Confirm", command=self.confirm) self.confirm.grid(row=2) def confirm(self): fileClass = open('ClassData.txt','r') for line in fileClass: classInfo=line.split(',') print "Name is:", self.Name print "This …

Member Avatar for chris99
0
96
Member Avatar for danizzil14

Ok, all I want ot know is how to close a script on command, lie type 3 to exit, what modules do i need to import and what is the command, I have everything else sorted out... EDIT: The close command will go in a if statement, which is in …

Member Avatar for ghostdog74
0
164
Member Avatar for mattyd

I am at the end of a build and am putting some minor touches on and testing; one area I suppose I took for granted (and have honestly not seen a need yet to fully deal with) is the Tkinter buttons. The buttons perform fine overall as to their function; …

Member Avatar for mattyd
0
18K
Member Avatar for sneekula

Is there a way to preselect/highlight a listbox item with the Tkinter GUI toolkit at the startup of the program without clicking the mouse on it?

Member Avatar for sneekula
0
1K
Member Avatar for scru

Hi. I've just registered, but I'm not exactly new to here (i've been lurking as a guest). I'm trying to make a countdown timer based on a class that I created, which accepts hours, minutes, and seconds as parameters and counts them down to zero, will displaying them in a …

Member Avatar for scru
0
810
Member Avatar for mattyd

I am searching for the syntax that will allow me to arrange widget buttons in a Tkinter GUI in a specific manner; currently I have three (3) buttons that are stacked[I] vertically[/I] on top of one another. I wish to arrange the buttons so that they form a row of …

Member Avatar for mattyd
0
3K
Member Avatar for mattyd

[U][B]I have two questions regarding Tkinter GUIs[/B][/U]:[LIST=1] [*]I have three buttons in a GUI; at times it seems that the buttons "stick". By this I mean when the mouse is clicked on one it may activate or it [I]may not[/I]. They all work correctly in regards to there function(s) but …

Member Avatar for mattyd
0
186
Member Avatar for chris99

I have the commands all ok, but even though the syntax is correct, the pic won't display. Here's the zip.

Member Avatar for Ene Uran
0
139
Member Avatar for AussieCannon

Hello, I am very new to python (a few days) and am wondering how i should go about generating random gridpoints and comparing them to ones inputted by the user. I am completely lost on how i can get the input of the x and y coordinates from the user …

Member Avatar for vegaseat
0
441
Member Avatar for vijay.neo

Hi All, Basically I (myself Vijay) am a C/C++ developer as i want to implement generic data type in C. i was searching in the google. then i come across similar kind of implementation in the python develoer chain. i was going through some of the mailing chain in [python-dev] …

Member Avatar for vegaseat
0
82
Member Avatar for defience

I'm still new to python and need some help writing a program. I need to write one that runs a *.exe and then checks some timings in it. There are 3 numbers ranging from 0<1000 that are hidden in the *.exe(app.exe). If the script runs the app.exe and then runs …

Member Avatar for vegaseat
0
156
Member Avatar for defience

I'm new to Python and this was written and posted by someone else on another site as a tutorial for a word unscrambler. I thought it was well written and liked the explanations but I tried to use it but keep getting an error message: line 27, in <module> letters …

Member Avatar for defience
0
125
Member Avatar for Shark7

I need to calcualte the scalar product given two lists of numbers... [code]v1=input("Insert the first vector: ") v2=input("Insert the second vector: ") for i in range(len(v1)): v3=v1[i]*v2[i] print v3 [/code] this code will multiplie all the numbers in list v1 and the numbers in list v2 but the result doesn't …

Member Avatar for Shark7
0
353
Member Avatar for vivekr

Is it possible to merge together python and javascript.. I am looking forward to fetching the contents of a webpage, parse them and use them in a webpage from javascript. I am a beginner in javascript and i couldn't find any means to fetch the contents(The webpage's entire source code) …

Member Avatar for bumsfeld
0
66
Member Avatar for chris99

What am I doing wrong, I've done it before! [CODE]class Main: def __init__(self, master): self.master = master self.master.title('Role Playing Form V1.0') self.master.geometry('300x250+350+450') self.master.mainloop() self.cmdCreate = Button(self.master, text='Create Character', command=self.create) self.cmdCreate.grid(row=0) def create(self): pass root = Tk() main=Main(root)[/CODE] the button doesn't appear!

Member Avatar for bumsfeld
0
136

The End.