<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Good. Thanks.<br>
<br>
Here's my code.<br>
==========<br>
# Executing a Linux program under Win XP<br>
from subprocess import call<br>
myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"])<br>
==========<br>
But msgs are produced ...<br>
Traceback (most recent call last):<br>
&nbsp; File
"C:/Sandia_Meteors/Sentinel_Development/Development_Sentuser-Utilities/sentuser/fun-subprocess_Linux.py",
line 4, in &lt;module&gt;<br>
&nbsp;&nbsp;&nbsp; myProg = call(["C:\Sandia_Meteors\Various\FuzzyLogic\wolf", "-h"])<br>
&nbsp; File "C:\Python25\lib\subprocess.py", line 444, in call<br>
&nbsp;&nbsp;&nbsp; return Popen(*popenargs, **kwargs).wait()<br>
&nbsp; File "C:\Python25\lib\subprocess.py", line 594, in __init__<br>
&nbsp;&nbsp;&nbsp; errread, errwrite)<br>
&nbsp; File "C:\Python25\lib\subprocess.py", line 816, in _execute_child<br>
&nbsp;&nbsp;&nbsp; startupinfo)<br>
<b>WindowsError: [Error 5] Access is denied</b><br>
<br>
I looked for the attributes on the file and it shows "A". I'm the admin
on my XP Pro, and the file is owned by Admin.<br>
wolf is a 1 meg file. <br>
<br>
Alan Gauld wrote:
<blockquote cite="mid:gpvk08$8st$1@ger.gmane.org" type="cite"><br>
"Wayne Watson" <a class="moz-txt-link-rfc2396E" href="mailto:sierra_mtnview@sbcglobal.net">&lt;sierra_mtnview@sbcglobal.net&gt;</a> wrote
  <br>
  <br>
  <blockquote type="cite">What is meant by "The arguments are the same
as for the Popen constructor.",
    <br>
in Convenience Functions? In fact, what is such a function?
    <br>
  </blockquote>
  <br>
It means that there is a function which takes the same arguments
  <br>
as the __init__() method of the Popen class.
  <br>
  <br>
They are convenience functions in that you don't need to create the
class
  <br>
to use them you can just call them directly. THe payoff is that you
lose
  <br>
some of the flexibility of using the class, but often you don;t need
that.
  <br>
  <br>
  <blockquote type="cite">class subprocess.Popen(args, bufsize=0,
executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None,
close_fds=False ....
    <br>
Why not just class Popen instead of subprocess.Popen?
    <br>
  </blockquote>
  <br>
The notation is saying that there is a class defined in the
  <br>
subprocess module called Popen with a constructor that
  <br>
has the listed parameters. It is just a shorthand way of
  <br>
expressing that.
  <br>
  <br>
In practice you would create an instance with either:
  <br>
  <br>
import subprocess
  <br>
p = subprocess.Popen(....)
  <br>
  <br>
OR
  <br>
  <br>
from subprocess import Popen
  <br>
p = Popen(....)
  <br>
  <br>
  <blockquote type="cite">Is there a suggestion here that I need only
do:
    <br>
  </blockquote>
from subprocess import Popen
  <br>
  <blockquote type="cite">myProg=Popen()
    <br>
myProg.call("wolf", "-h")
    <br>
  </blockquote>
  <br>
Even simpler, you only need:
  <br>
  <br>
from subprocess import call
  <br>
myProg = call(["wolf", "-h"])
  <br>
  <br>
You need to put the command as the first entry of a list and each
  <br>
argument as a separate entry
  <br>
  <br>
HTH,
  <br>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html;" http-equiv="Content-Type">
<title>Signature.html</title>
<pre class="moz-signature" cols="76">           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)<span
 style="font-weight: bold;"></span><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="color: rgb(255, 153, 255);"></span><span
 style="font-family: monospace;"></span></b></b>
<span style="color: rgb(102, 0, 204);"></span><span
 style="color: rgb(102, 0, 204);"></span>

<span style="color: rgb(102, 0, 204);">                </span><font
 class="sqq"><span style="color: rgb(102, 0, 204);">&#8220;</span><span
 class="sqq" style="color: rgb(102, 0, 204);">Life is one damn thing after another."
                     -- Mark Twain </span></font>
</pre>
</div>
</body>
</html>