I do that without the IDE:
$ ipython $ edit file.py $ :x (save and close)
It executes Python code, but not the one, where I use Pygame. It gives:
WARNING: Failure executing file:
In the IDE, my code executes.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If something doesn’t work in
ipython, try the real Python interpreter (justpython);ipythonhas known bugs, and not infrequently code known to work in the real interpreter fails there.On UNIXlike platforms, your script should start with a shebang — that is, a line like the following:
should be the very first line (and should have a standard UNIX line ending). This tells the operating system to execute your code with the first python interpreter found in the
PATH, presuming that your script has executable permission set and is invoked as a program.The other option is to start the program manually — as per the following example:
…or, to use a specific version of the interpreter (if more than one is installed):