Feedback

MRAB google at mrabarnett.plus.com
Sat Nov 22 21:15:05 CET 2008


Ali art wrote:
> I am using Windows XP professional version 2002 Service pack 3. AMD 
> Athlon(TM)XP 2400+ 2.00GHz 992MB RAM.
> I have download Windows x86 MSI Instaler (3.0rc2) Python 3.0rc2 Release: 
> 06-Nov-2008.
> 
> I want to use source code file from Python Command line but I could not.
>  
> Firstly i opened IDLE and clicked on File → New Window and pasted 
>  #!/usr/bin/python
> #Filename: helloworld.py
>  
> print('Hello World')
> and saved  "helloworld.py" without quotes.Then i invoced pyton command line.
> Python 3.0rc2 (r30rc2:67141, Nov  7 2008, 11:43:46) [MSC v.1500 32 bit 
> (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> python helloworld.py
> and pressed enter
> But it did not work gives the error

That would work only in a Command Prompt window.

>  Python 3.0rc2 (r30rc2:67141, Nov  7 2008, 11:43:46) [MSC v.1500 32 bit 
> (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> python helloworld.py
>   File "<stdin>", line 1
>     python helloworld.py
>                     ^
> SyntaxError: invalid syntax
>  >>>
> Did i meke any misteke? I tried
> Control Panel -> System -> Advanced -> Environment Variables.
> System Variables -> C:\Python30
> but it still gives same error.
> 
You can open it in IDLE and run it with Run → Run Module or press F5.

Alternatively you can double-click on the file in Windows Explorer, 
although the window would close as soon as the program had finished.



More information about the Python-list mailing list