>>> python test1.py / Traceback ( File "<interactive input>", line 1

Ben Finney bignose-hates-spam at and-benfinney-does-too.id.au
Tue Nov 25 20:11:55 EST 2003


On Wed, 26 Nov 2003 00:19:39 -0000, leroybt.rm wrote:
>   >>> python test1.py
>   Traceback ( File "<interactive input>", line 1
>   python test.py
>   ^
>   SyntaxError: invalid syntax

'python' is not a python command.

When you write a file intended to run as a script, run it as a command
from your operating system's command line: 'python test1.py'.  This
tells 'python' (the program, invoked as a command) to interpret the
contents of the file 'test1.py' and execute all commands within it.

The interactive prompt, provided by typing 'python' with no arguments at
your operating system command prompt or by running PythonWin or other
tools, is for interactively typing in the Python statements found
*within* Python files:

    >>> import string
    >>> foo = 'blah'
    >>> print foo
    blah
    >>>

-- 
 \        "Misogynist: A man who hates women as much as women hate one |
  `\                                    another."  -- Henry L. Mencken |
_o__)                                                                  |
Ben Finney <http://bignose.squidly.org/>




More information about the Python-list mailing list