Running script in __main__ shows no output in IDLE
bdesth.quelquechose at free.quelquepart.fr
Tue May 23 03:15:39 CEST 2006
heidi.hunter at fantasy-interactive.com a écrit :
> I just downloaded the most recent (2.4.3) Python and IDLE (1.1.3) to
> Windows XP Professional. I'm new to the IDLE environment, so hopefully
> someone can tell me what I'm missing here! Below is the code, which I'm
> editing within IDLE, and attempting to test with the Run commands.
> I was expecting to see at least see the prints to stdout from the if
> __name__ ... statement and main() function, but when I use F5 Run
> module I don't see any output or errors. Any suggestions? Does IDLE
> still need the executable file statement at the top even if I run it
I can't tell you about IDLE related stuff (I don't use it myself), but
FWIW, you have a problem with main()'s 'arg' param : you use it like this:
but pass it like this:
The first problem is that:
already raises an exception ('ValueError: invalid \x escape').
The second problem is that somestring returns the first characted of
First correct your code, then see what happens. And eventually, find a
better tool than IDLE...
More information about the Python-list