On Thu, Jun 14, 2012 at 5:30 PM, Tom Avos <[email protected]> wrote: > Hi there, > I'm learning Python. I have to work with a Notebook running Widows Vista > Home Premium.(have no other choice) > It works fine when working in Interactive Mode or by Opening a .py file > from the IDLE and then running it by pressing F5, but I can not run .py > files by invoking them from the prompt (neither from IDLE nor Dos Command > Line); > > Every time I try to do this I get the following error:(In this case I'm > tryig to invoke triangulo.py saved in C:\python27); > >>>> triangulo.py > Traceback (most recent call last): > File "<pyshell#3>", line 1, in <module> > triangulo.py > NameError: name 'triangulo' is not defined >>>> > > The same happens for every file I want to run by calling them from the > prompt, although if I double click on any .py file it runs ok. > > I've installed Python as follows: > > I've downloaded the Python 2.7.3 Windows Installer from > www.python.org/download/. > Once I've got it I run the installer and Python was installed on > C:\Python27, and I've added Python to the my directory by doing set > path=%path%;C:\python27. > > Any ideas will be very welcome :-) > Thanks in advance for your attention. > > > _______________________________________________ > Tutor maillist - [email protected] > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
That's not how you run files. python path-to-your-file If it isn't in your %PATH% (it might not be, as you need to set it in Computer->Properties->Advanced system settings->Environment Variables), prepend it with c:\python27\. And please don't put them in C:\Python27\, it isn't supposed to be used for that. -- Kwpolska <http://kwpolska.tk> stop html mail | always bottom-post www.asciiribbon.org | www.netmeister.org/news/learn2quote.html GPG KEY: 5EAAEA16 | Arch Linux x86_64, zsh, mutt, vim. # vim:set textwidth=70: _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
