running a python script in drpython

john techguy at att.net
Sun Mar 13 23:29:11 CET 2005


john wrote:
> 
> Haveing problems writeing a program then running it in python 2.3.5 
> interpreter.  Called the program test.py used chmod to make it 
> executable in linux
> 
>> #! /usr/bin/python
>> print 2** 8
>> print 'the bright side ' + 'of life'
> 
> 
>  >>> python test.py
>   File "<stdin>", line 1
>     python test.py
>               ^
> SyntaxError: invalid syntax
> how do you run a script you create in the python interpreter?
> 
> Thanks
> John

You have to import the script into the interpreter.

 >>> import test
256
the bright side of life



More information about the Python-list mailing list