Calling program on remote machine

Hi
How do I call a program over vpn?  The program produces a text fiile that I then download.
gregbinnsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rjkimbleCommented:
Is this a Python question?
0
gregbinnsAuthor Commented:
Yes
I want to call a python program from a python program.
Import is difficult because it is on a remote box.
Thanks
Greg
0
rjkimbleCommented:
If you can see the remote directories as regular directories, you can add things to sys.path and then use import:

import sys
sys.path.insert( 0, remote_dir )
import your_module # where your_module is in remote_dir

Does that help?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

gregbinnsAuthor Commented:
Thanks
Could help but what I was really looking for was something like the VB Call(C:\myprog.exe) function.
Any clues
Regards
Greg
0
rjkimbleCommented:
The various popen methods from the os and popen2 modules should do what you want. I'm not really familiar with VB, so I don't know what features Call() provides. popen, popen2, popen3, and popen4 all execute a method in a child process and provide access to stdin, stdout, and stderr of the child process. Is that what you're looking for?
0
hweberCommented:
Do I understand you right that you want the called program to execute on the remote machine, not on the machine the calling program is on? If the called programm doesn't provide some kind of rpc calling mechanism, you would need some way to connect to the remote machine that allows you to execute commands there. One of the simplest ways would be telnet if the remote machine offers this.

For this you could use the telnet library which is part of the Python standard library. Connect to the remote machine, wait until it requests your username and password, answer those queries and then call the program you want to run. Wait until it finishes running, then download the result file.
0
nochkinCommented:
If you can access your remote box over tcp network then I would suggest to use Pyro (Python Remote Object).
That will let you to access Python classes remotely from your local python script and get your data directly without having downloading it, synchronizing and playing other games to get your file complete etc.
http://pyro.sourceforge.net/

There are some other projects like this you might want to look into:
http://www.fnorb.org/
0
nochkinCommented:
If you want just to execute some other program then you can use os module:

import os
os.system('myscript.py')
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.