Shell: run script

L

leroybt.rm

Can someone tell me how to run a script from a interactive shell

I type the following:

and in all cases I get errors. I can't believe I can not run
a script from the shell.

What am I doing wrong?????

Help!!!!!!!!!
 
V

vincent wehren

| Can someone tell me how to run a script from a interactive shell
|
| I type the following:
|
| >>>python filename
| >>>python filename.py
| >>>run filename
| >>>run filename.py
| >>>/run filename
| >>>/run filename.py


You want to run a script from *inside the Python Interactive Shell*? Or do
you want to run a Python script (*.py) as a program from any (other than the
Python shell)? Or did you mix these two things up?


Vincent Wehren







| and in all cases I get errors. I can't believe I can not run
| a script from the shell.
|
| What am I doing wrong?????
|
| Help!!!!!!!!!
|
|
 
L

Logan

Can someone tell me how to run a script from a interactive shell

I type the following:


and in all cases I get errors. I can't believe I can not run
a script from the shell.

Normally, you do not want to run your scripts from a Python shell,
but from the bash etc. (Linux shells) or from a DOS console
(Windows) etc. For this, you use:

python <path_to_file>

If you really want to run a script from the Python shell, the
following will do:

execfile("<path_to_file>")

HTL, L.
 
W

Wojtek Walczak

Dnia Wed, 26 Nov 2003 18:40:05 -0000, leroybt.rm napisa³(a):
Can someone tell me how to run a script from a interactive shell

You mean interactive session? If yes, then do:

import os
os.system('/path/to/a/script')
 

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

Forum statistics

Threads
474,173
Messages
2,570,938
Members
47,473
Latest member
pioneertraining

Latest Threads

Top