Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #98354
| From | Chris Gonnerman <chris@gonnerman.org> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Puzzled |
| Date | 2015-11-06 07:40 -0600 |
| Message-ID | <mailman.87.1446818476.16136.python-list@python.org> (permalink) |
| References | <4CFEDC132D44AC49BA0E91FBEB947119084A742852@DCBL123VX.root.sutterhealth.org> <201511011020.tA1AKYAM004182@fido.openend.se> <4CFEDC132D44AC49BA0E91FBEB947119084A8D5E6C@DCBL123VX.root.sutterhealth.org> |
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.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Puzzled Chris Gonnerman <chris@gonnerman.org> - 2015-11-06 07:40 -0600
csiph-web