difference between IDLE and command line

Jim Hendricks jim at bizcomputinginc.com
Fri Nov 2 17:38:07 CET 2007


New to Python, and just had something strange happen.

I've been running my new code in IDLE running in windows.  My IDLE 
version shows as 1.2.1, Python version displaying in IDLE is 2.5.1.

I have been editing my code in UltraEdit then testing in IDLE by 
choosing open, then F5.  I didn't see an easy way to refresh in IDLE, so 
each edit I've been closing the file (not IDLE itself), then opening 
again.  Since IDLE does not keep track of what directory I last opened 
from, this gets tedious, so I decided to run my code from the command line.

Here's where it got interesting for me.  From the command line, I'm in 
the directory containing my source, I execute via "python mycode.py", I 
receive an error in my code.  Specifically, it's erroring because I have 
a copyright character in a string that I am outputting via the 
file.write method.  The error has to do with no encoding declared.

What surprised me is that this code runs with no problems in IDLE.

Should I expect different execution behavior between IDLE and a command 
prompt?

Oh, and executing python all by itself in the command prompt shows the 
same version as what is displayed in IDLE.




More information about the Python-list mailing list