Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Forsaken

macrumors regular
Original poster
Dec 1, 2009
214
0
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:
Code:
#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?
 
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).
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.