running a python script in drpython

J

john

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'
File "<stdin>", line 1
python test.py
^
SyntaxError: invalid syntax
how do you run a script you create in the python interpreter?

Thanks
John
 
D

Dennis Lee Bieber

File "<stdin>", line 1
python test.py
^
SyntaxError: invalid syntax
how do you run a script you create in the python interpreter?
Normally, you don't...

You go out to the command shell, where you no doubt typed
"python" to even get the interpreter started, and type "python test.py"
THERE...

--
 
J

john

john said:
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

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.
256
the bright side of life
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top