FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How can I run external program in python





maramr_08
i'm new programer in python
i have a problem to run prolog file from python.

and at the same time i will forwarde the value of varibles from python program to prolog filr yhen i will nedd to read the result

any help or suggestions
Maram
pedepy
see if this would suit your needs:

http://www.python.org/doc/2.5.2/lib/module-popen2.html
albuferque
I guess you are looking for os.system, as in:

import os
cmd = 'ls -l /usr/bin'
os.system(cmd)

Note that this will not capture the output of the system command; you
can use the os.popen family of commands to do that.

For more info on process control, take a look at:

http://www.python.org/doc/current/lib/os-process.html
Related topics
C++ TUTORIAL : INTRODUCTION TO C++
Creating a new Operating System
warning
Gaining Speed In Xp
Fortran Tutorials(77)
is there a program that...
Programming in a lot of languages
DreamWeaver or Visual Studio
Python execute External Application. How?
ejecting USB drive.
Do external link Exchange and bandwidth limit voilate TOS?
Try to find local network adress
Writing your first Java Program
Auto Run a Program if Closed?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.