[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Newbie question
From:       Charlie Clark <charlie () begeistert ! org>
Date:       2001-05-28 14:08:26
[Download RAW message or body]


>>>> python 1.py
>   File "<stdin>", line 1
>     python 1.py
>             ^
> SyntaxError: invalid syntax
>>>>
>
> Clearly I'm doing something wrong but what?
>
You have started the interactive prompt - which is where you can test
bits of code on the fly. You don't need to do this if you just want to
run a program. You just put the program name after python like "python
1.py" if you're in windows or simply "1.py" if you're working in another
operating system.

You might want to try using IDLE for all this as Windows is not really a
nice place to use a command line interpreter. IDLE allows you run
programs you've written and helps manage the ones you have open. It
should have been installed when you installed Python.

Should you want to call the program you've written while you're working
in the interactive prompt you would use import. >>>"import 1.py" or
"from 1.py import ..."

Charlie
-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic