Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 7 Online
OpenStudy (anonymous):

Windows 7 path variable problems? After spending some time with the first three assignments, I went back around and looked closer at the readings. In 1.1 of 'How to. . .' it shows an example of calling a python script from the shell: "python latoya.py". I've modified the user and system path variables using dos shell, the windows gui, and tried also by editing the value in the registry and I'm STILL getting "File "<"stdin">, line 1. . . " when I execute the script as shown by the example. Has anyone else experienced this and been able to resolve? If I use 'execfile("latoya.py")' it runs.

OpenStudy (anonymous):

from http://docs.python.org/using/windows.html 3.3.2. Finding the Python executable¶ Besides using the automatically created start menu entry for the Python interpreter, you might want to start Python in the DOS prompt. To make this work, you need to set your %PATH% environment variable to include the directory of your Python distribution, delimited by a semicolon from other entries. An example variable could look like this (assuming the first two entries are Windows’ default): C:\WINDOWS\system32;C:\WINDOWS;C:\Python25 Typing python on your command prompt will now fire up the Python interpreter. Thus, you can also execute your scripts with command line options, see Command line documentation.

OpenStudy (anonymous):

Thank you. That works great. I was worried that, down the road, python might have trouble finding a reference when I start putting chunks of code in separate files, since the interpreter didn't return what I expected by calling the script with the exact syntax shown in the python example. I'm a little gunshy because of some trouble I've had getting IntelliJ to reference jar files according to the directory references in the home paths for various collections.

OpenStudy (anonymous):

Make sure you save it with a .py extension.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!