0

Is it possible to run a System process remotely , i.e. in the background using python?

For e.g. I ave Scilab installed on my system, now I do something like this

                 xx= os.system('scilab-adv-cli')

in the python console. But this fires up an actual scilab command line interface. Though I need something like this :

                  xx.add(1,2)

here is some function predefined in scilab module whic on invoking should return 3 here. CAn this be done?

1
  • I think you're looking for subprocess. It will allow you to feed STDIN and receive STDOUT from scilab-adv-cli. docs.python.org/library/subprocess.html Commented Sep 30, 2011 at 21:31

1 Answer 1

1

If this is limited to Scilib, check out http://forge.scilab.org/index.php/p/sciscipy/

which should let you do everything scilib can do from within python.

Also, while this doesn't solve your problem, you should considering using subprocess instead of os.system

http://docs.python.org/library/subprocess.html#module-subprocess

Sign up to request clarification or add additional context in comments.

2 Comments

In other words: 1) Use python bindings if they exist for your package 2) Otherwise, use subprocess to communicate with an external command
3) pexpect can be a useful tool for communicating with interactive (text-mode) programs locally or remotely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.