[Tutor] I can't know how to use the "press the enter key to exit" command

2010-07-06 Thread erinzo
Sorry, I am a beginner in the python programming language.But went I type raw input("\n\npress the enter key to exit.") in the last line of the program,I have the syntaxerror.My program can not wait the user to press the enter key.___ Tutor maillist -

Re: [Tutor] raw_input

2010-07-06 Thread iamroot
On Mon, 5 Jul 2010, Dipo Elegbede wrote: Hello, I seem to be having problems with raw_input. i wrote something like: raw_input('Press Enter') it comes back to tell me raw_input is not defined, a NameError! Is it that something about it has changed in python 3.1 or I have been writing the w

[Tutor] Tkinter mainloop()

2010-07-06 Thread Francesco Loffredo
Hello all, this is the first time I ask for advice but I've been lurking for some month and i'm sure I'll find more than I need. I'm learning Python and Tkinter, and I chose an old board game as a practice field. I used a Canvas and many Polygons, one for each hexagonal space of the board, and I

Re: [Tutor] I can't know how to use the "press the enter key to exit"command

2010-07-06 Thread Alan Gauld
"erinzo" wrote Sorry, I am a beginner in the python programming language. But went I type raw input("\n\npress the enter key to exit.") in the last line of the program,I have the syntaxerror. If you are using Python v2 use raw_input() # note the underscore If you are using Python v3

Re: [Tutor] I can't know how to use the "press the enter key to exit" command

2010-07-06 Thread Camillo Pereira
On 6 July 2010 17:27, Camillo Pereira wrote: > Hi, > > Can the error message be posted along with the Python code please. > > Regards, > > Camillo > > On 5 July 2010 23:52, erinzo wrote: > >> Sorry, I am a beginner in the python programming language.But went I >> type raw input("\n\npress the e

[Tutor] Sorting the Dictionary Set?

2010-07-06 Thread Ken G.
Is there a way to sort a dictionary? Assuming I have a dictionary set containing the following: {'02': 1, '03': 1, '12': 1, '15': 2, '14': 2, '04': 3, '05': 1, '19': 1, '32': 1, '28': 1, '27': 1, '17': 2, '25': 1} and using the following code: print ('Printing the result of numbers that

Re: [Tutor] Sorting the Dictionary Set?

2010-07-06 Thread Shashwat Anand
On Tue, Jul 6, 2010 at 8:08 PM, Ken G. wrote: > Is there a way to sort a dictionary? > > Assuming I have a dictionary set containing the following: > > {'02': 1, '03': 1, '12': 1, '15': 2, '14': 2, '04': 3, '05': 1, '19': 1, > '32': 1, '28': 1, '27': 1, '17': 2, '25': 1} > > and using the followi

Re: [Tutor] Sorting the Dictionary Set?

2010-07-06 Thread Steven D'Aprano
On Wed, 7 Jul 2010 12:38:55 am Ken G. wrote: > Is there a way to sort a dictionary? Not directly, dictionaries are unsorted and unsortable. They print in an arbitrary order. If you need to operate on dictionaries in a specific, non-arbitrary order, you need to extract the keys, sort them, and t

Re: [Tutor] Tkinter mainloop()

2010-07-06 Thread Alan Gauld
"Francesco Loffredo" wrote How can I ask a Canvas to redraw itself at my command? And if i can't, when should I call the auto move? You can ask the canvas to repaint itself by calling update_idle_tasks() method. But in general you shouldn't need to. It's usually better to keep your event h

[Tutor] newbie to gui programming

2010-07-06 Thread Payal
Hi all, Some background before the actual query. A friend of mine, an electronics engineer has a small co. He had a computer engg. with him who used to design GUI front-ends for his products in Visual Basic. These apps used to take data from serial port, store it on disk put and show it in excel al

Re: [Tutor] the ball needs a kick...

2010-07-06 Thread Dave Angel
Schoap D wrote: Hi, I'm doing the exercises here: chapter 8 http://www.openbookproject.net/thinkCSpy/ch08.html Now I have added another paddle to the pong game. So far so good, but the ball isn't moving anymore and I am not able to fix it... Any comments, tips, feedback? Thanks in advance, ht

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Adam Bark
On 6 July 2010 18:09, Payal wrote: > Hi all, > Some background before the actual query. > A friend of mine, an electronics engineer has a > small co. He had a computer engg. with him who used to design GUI > front-ends > for his products in Visual Basic. These apps used to take data from > serial

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Alan Gauld
"Payal" wrote gui programming? There seems to be many ways to do gui programming in Python namely wxpython, tkinter, gtk, qt etc. Which is the easiest There are many toolkits but these have as many similarities as differences. But none of them will be easy to learn if you have not done GUI

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Eric Hamiter
If you decide to run with wxPython there is a pretty handy video series you could watch: http://showmedo.com/videotutorials/series?name=PythonWxPythonBeginnersSeries Eric On Tue, Jul 6, 2010 at 1:48 PM, Alan Gauld wrote: > "Payal" wrote > > gui programming? There seems to be many ways to do

Re: [Tutor] newbie to gui programming

2010-07-06 Thread Nick Raptis
Please excuse if I'm jumping on the topic. Haven't done any GUI work so this interests me too. wxPython always seemed a great choice as it works on all platforms, and uses GTK+ for linux. Well, what mainly bugs me about wxPython is that most of it's API names come from the wx C library, you al

Re: [Tutor] newbie to gui programming

2010-07-06 Thread John
On Tuesday 06 July 2010 05:35:34 pm Nick Raptis wrote: > Please excuse if I'm jumping on the topic. Haven't done any GUI work so > this interests me too. > > wxPython always seemed a great choice as it works on all platforms, and > uses GTK+ for linux. > Well, what mainly bugs me about wxPython is

Re: [Tutor] Tkinter mainloop()

2010-07-06 Thread Francesco Loffredo
RTFM I happened to find the answer just a couple of hours after having sent this message. How could I miss the update method of the Canvas? Now my game works as expected, maybe I'll post it when it's complete. Thanks to all! Francesco Il 05/07/2010 21.00, Francesco Loffredo ha scritto: He

Re: [Tutor] Tkinter mainloop()

2010-07-06 Thread Francesco Loffredo
Il 06/07/2010 17.32, Alan Gauld wrote: "Francesco Loffredo" wrote How can I ask a Canvas to redraw itself at my command? And if i can't, when should I call the auto move? You can ask the canvas to repaint itself by calling update_idle_tasks() method. Thank you, Alan. As many answers, this p