14,946 Topics

Member Avatar for
Member Avatar for mattyd

I have read that Python does [I]not[/I] have built-in support for multi-dimensional arrays-- is this still the case or has this been developed and updated in the last few years for this language? I have researched this and seen references to multi-dimensional arrays and various work-arounds: dictionaries, lists, and various …

Member Avatar for jrcagle
0
424
Member Avatar for alba07

I am to create an old-style class with a constructor __str__, and accessor methods, such that the following code: abook = Book(author = "Amy Doe", title = "Sun rise", price = 13.50) print abook.getAuthor() print abook.getTitle() print abook.Price() print abook Output should be as follows: Amy Doe Sun Rise 13.50 …

Member Avatar for jrcagle
0
236
Member Avatar for alba07

I am supposed to design a GUI for ls, where the user could select these options from pull down menus. After the user selects options, clicking on go should run the ls. The way I am understanding this is that could either use a text widget or labels. Here is …

Member Avatar for alba07
0
78
Member Avatar for itajit

Hi Im usig SWIG with Python and facing problem in compiling the wrap file genereted by the SWIG. The error is can not open include file Python.h.And hence the object file of wrap file can not be generated, so plzzzzzzzz help me by suggesting the steps for the prob I …

Member Avatar for vegaseat
0
113
Member Avatar for caranjo

Hi, I am new to python (in fact this is my 2nd day learning it) I was given code that resembles: [code] if xyz #do abc return x else return y return[] [/code] What does the return[] do? Sorry if this is a stupid question.;)

Member Avatar for ghostdog74
0
67
Member Avatar for R.S.Chourasia

Hi, I am using SWIG to generate the wrapper for python i.e. I am tring to correlate the c++ and python2.4. I am using the windowsXP platform with Visual Studio 2005 Editor and the Turbo c++ complier. The problem is that after Generating the c++ file and the python file …

Member Avatar for bumsfeld
0
123
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
160
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
157
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
159
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
109
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
201
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
86
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
274
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
104
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
57
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
93
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
204
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
92
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
163
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
743
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
183
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
137
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
429

The End.