PDA

View Full Version : Need some help with Python 2.6 (resolved)




Forsaken
Dec 13, 2009, 05:09 PM
NOTE: I've figured everything out now. I also switched to 3.0

This has been bugging me for quite some time.

I just started seriously using Python (in this case, version 2.6) and made this .py script:
#easy!
print "Mary had a little lamb,"
print "it's fleece was white as snow;"
print "and everywhere that Mary went",
print "her lamb was sure to go."

when I import it into IDLE it works fine.

But when I drag it to Python Launcher, PL opens very quickly then closes, within the space of a second. Same for Build Applet. And when I launch it from the finder into IDLE, it just shows the code, not the result. I mean, the files are placed in an area searched by sys.path (my documents folder) but nothing works. Help?



Detrius
Dec 13, 2009, 10:58 PM
Well, you could start with a proper shebang at the beginning of your script:

#!/usr/bin/env python

If you haven't already, try making the script executable (chmod +x).

Forsaken
Dec 14, 2009, 04:00 PM
Actually, about making it an applet or app is irrelevant at the moment, and I discovered that when I open it and shows only the code, it's the edit window, not the actual prompt window. So it's been resolved.