473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

executing an external app

Hi all,

I have a simple question which I cannot solve (relatively new to Python).
I want to write a script that executes an application on the go. I looked
into the exec*e() calls but the problem there is that they do not return.
I also looked into execfile() but here the PATH is not taken into account
and I couldn't figure out to pass the file that's executed arguments.

So, is there a simple way to execute an external app?
i.e. execvpe('cat', 'myFile') - this will not return

Thanks,
Joseph
Jul 18 '05 #1
5 1173
Joseph Krauze wrote:
Hi all,

I have a simple question which I cannot solve (relatively new to Python).
I want to write a script that executes an application on the go. I looked
into the exec*e() calls but the problem there is that they do not return.
I also looked into execfile() but here the PATH is not taken into account
and I couldn't figure out to pass the file that's executed arguments.

So, is there a simple way to execute an external app?
i.e. execvpe('cat', 'myFile') - this will not return

Thanks,
Joseph


Look at os.spawn* or os.popen*

--
Soraia: http://www.soraia.com
Jul 18 '05 #2
In article <GJ*********************@news.easynews.com>,
Joe Francia <usenet@-OBFUSCATION-joefrancia.com> wrote:
Joseph Krauze wrote:
Hi all,

I have a simple question which I cannot solve (relatively new to Python).
I want to write a script that executes an application on the go. I looked
into the exec*e() calls but the problem there is that they do not return.
I also looked into execfile() but here the PATH is not taken into account
and I couldn't figure out to pass the file that's executed arguments.

So, is there a simple way to execute an external app?
i.e. execvpe('cat', 'myFile') - this will not return

Thanks,
Joseph


Look at os.spawn* or os.popen*

Jul 18 '05 #3
Try one or more of these:

os.system, os.spawn*, popen2.*, os.fork + os.exec* (where os.fork is
supported, at least), popen5 (third-party module, posix/unix only),
win32??? (not sure of name, included in win32all, for Windows only)

Jeff

Jul 18 '05 #4
Jeff Epler wrote:
Look at os.spawn* or os.popen* .
.
.

On Wed, Jan 28, 2004 at 09:29:42PM -0000, Cameron Laird wrote: And os.system(). And commands.getoutput().


[jepler@parrot jepler]$ python -c 'import this' | grep "only one"
There should be one-- and preferably only one --obvious way to do it.

*sigh*

Jeff

Jul 18 '05 #5
[Jeff Epler wrote]
Try one or more of these:

os.system, os.spawn*, popen2.*, os.fork + os.exec* (where os.fork is
supported, at least), popen5 (third-party module, posix/unix only),
win32??? (not sure of name, included in win32all, for Windows only)


You could try process.py. Windows and Unix.

http://starship.python.net/crew/tmick/#process

Cheers,
Trent

--
Trent Mick
Tr****@ActiveState.com

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dariusz | last post by:
I currently have a layout that is part written in SHTML - in other words, it gets processed by the web server to execute any calls for PHP or Perl code as well as the html (and external imported...
0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a "Module not found" error. This PEP aims to fix that...
0
by: Ian Warford | last post by:
Hi, I have a problem with a PL/PerlU function trying to execute an external perl script. The script is suid to a non-root user and I am executing it in the PL/PerlU function as so : $rc =...
0
by: rilian | last post by:
For those encountering the 'Error executing child request for...' error, the following may bring some light on the problem. It is possible that the page you are transfering/executing to is...
0
by: **Developer** | last post by:
This is almost the same as a previous post that is still giving me a problem, but with a different slant. I can't seem to find out what is wrong. My program crashes after it leaves an event...
0
by: google | last post by:
Hi everyone, >From my WinForms app I am executing an external process. It turns out that I have replaced the EXE of the external process with a newer version and my WinForms app is still...
2
by: LordChaos | last post by:
Dear all, I am a newbie in Java, I got the following problem: I am going through a list of directories. The programm looks inside each directory for specific files and writes them in an...
0
by: GeoffW | last post by:
Hi there I am fairly new to VS.NET2005 and am looking to write a piece of code in C# that will execute an external object using the Process.CreateProcess() function. The object in question will be...
2
by: jamesGE | last post by:
HI i have inherited a Tool at work and when i go to compile this is the errors i am getting Linking... Creating library ..\..\..\VCProject32\common\Dlls_Libs/Release/dsdev32.lib and object...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.