473,395 Members | 1,556 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,395 software developers and data experts.

Popen3-style os.execl?

Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...

Cheers,
Chris
--
Chris Green <cm*@dok.org>
Don't use a big word where a diminutive one will suffice.
Jul 18 '05 #1
4 1790
In article <m2************@catbert.dok.org>, Chris Green <cm*@dok.org>
wrote:
Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...


Did you try it? I think of Popen3 as something that
acts just like you describe, but also accepts a command
line. Not the best API, maybe.

Donn Cave, do**@u.washington.edu
Jul 18 '05 #2
Chris Green <cm*@dok.org> writes:
Hey folks,

I'm whipping up a quick CGI to wrap a command line app and I was a bit
suprised to not find a execl-like Popen3 style object. I don't want
to bother with the shell interpreting metacharaters by constructing a
command line.

Basically, I want something that acts just like Popen3 but allows me
to specify cmd as a path + args. Does something like this exist in
the standard library? If not, it sounds like a good candidate...


Um. Can't you pass a list to the Popen3 constructor?

Cheers,
mwh

--
same software, different verbosity settings (this one goes to
eleven) -- the effbot on the martellibot
Jul 18 '05 #3
Michael Hudson <mw*@python.net> writes:
Um. Can't you pass a list to the Popen3 constructor?


Well, by golly ya can. Since cmd is only ever one argument in the
docs, I've never known that you could do this.
--
Chris Green <cm*@dok.org>
This is my signature. There are many like it but this one is mine.
Jul 18 '05 #4
Chris Green <cm*@dok.org> writes:
Michael Hudson <mw*@python.net> writes:
Um. Can't you pass a list to the Popen3 constructor?


Well, by golly ya can. Since cmd is only ever one argument in the
docs, I've never known that you could do this.


Ah, uh, right: this isn't documented. I'm not sure why... as noted,
it doesn't work on Windows, but then if you were talking about execl,
you presumably aren't that concerned.

Cheers,
mwh

--
Reading Slashdot can [...] often be worse than useless, especially
to young and budding programmers: it can give you exactly the wrong
idea about the technical issues it raises.
-- http://www.cs.washington.edu/homes/k...t.html#reasons
Jul 18 '05 #5

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

Similar topics

2
by: selwyn | last post by:
hi all, I would like some advice on how I can include a timeout for a scanning operation using unzip on linux and os.popen3. I am scanning through about 30g of rescued zip files, looking for...
2
by: Rajarshi Guha | last post by:
Hi, I have some code that runs an interactive program via popen3(). The program generates output which is then used later on. My script looks like this: o,i,e =...
1
by: | last post by:
This could possibly be a bug, but I don't understand it fully so I'm posting here first. Searching the list told me other people are having this problem too. I have created a class which...
1
by: Ruchika | last post by:
Hi, I want to build an embedded Visual C++ project from the python script. This is what I do - evc = r'"C:\Program Files\Microsoft eMbedded C++ 4.0\Common\EVC\Bin\EVC.EXE"' proj =...
13
by: Russell E. Owen | last post by:
I'm trying to launch an application from Python 2.3 on Windows. The application is "ds9" (an image viewer), and is installed in C:\Program Files\ds9\ds9 On unix I just do: os.popen3("ds9") and...
2
by: Jakob Simon-Gaarde | last post by:
Follow-up on a thread from 1999 (see below) Well now it is 2005 and the operating system I'm using is Windows Server 2003, and I can still see that the same problem persists with: ...
2
by: Jeffrey Barish | last post by:
I have an application that has been working fine on Linux, but now I need to port it to Windows XP. The program uses Popen3 to run another program. I use Popen3 so that I can access the pid...
2
by: Pierre Rouleau | last post by:
Hi all, I have a consistent test case where os.popen3() hangs in Windows. The system hangs when retrieving the lines from the child process stdout. I know there were several reports related to...
0
by: Jonathan Mark | last post by:
hi all... I wrote a seemingly simple function (below) to use Popen3() and select() to run a program and capture its exit status, stdout output, and stderr output. It worked fine until the box...
0
by: Rocky Zhou | last post by:
python unzip At first, I tried to use 'os.popen3("unzip ...") like this: fin, fout, ferr = os.popen3("unzip -o -d %s %s" % (dest, zipfile)) strerr = ferr.read() # This makes the program hanging...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.