Puzzled
Robinson, Wendy
RobinsW1 at sutterhealth.org
Fri Nov 6 16:36:00 EST 2015
Ah, ok.... I get it now.
Thanks both!
Wendy Robinson
Audit Analyst
-----Original Message-----
From: Chris Gonnerman [mailto:chris at gonnerman.org]
Sent: Friday, November 06, 2015 5:40 AM
To: python-list at python.org
Cc: Robinson, Wendy
Subject: Re: Puzzled
Wendy said:
> I installed Python 3.5.0 64-bit for Windows yesterday and tried some basic programs successfully.
> This morning I rebooted my computer and can't get a single one to work. The interpreter seems to be fine and the environment variables look correct. But every py file I try to run at the >>> prompt gives me a NameError.
But that's not how the Python interpreter works. You say you are trying to run "py files" at the >>> prompt. If what you are doing is this:
>>> test.py
Well, no, that's not going to work. If you want to run "test.py" as a script, from the CMD prompt you type:
python test.py
If test.py is a module meant to be imported, then from the Python prompt you do this:
import test
Hope this helps.
-- Chris.
More information about the Python-list
mailing list