Re: calling command line programs?



On 2005-09-11, Yevgeniy (Eugene) Medynskiy <ym66@xxxxxxxxxxx> wrote:

> This is probably a very newbie question, but after searching
> google and docs @ python.org I can't find an answer, so maybe
> someone would be able to help?
>
> I'd like to call command-line functions from my python script
> (like you would in perl using backticks)... Is there a way of
> doing this? And if so, how does the environment get treated (I
> have some variables in my env that the programs I'd be calling
> need to see).

Take a look at os.popen, os.spawn, or the popen2, and
subprocess modules.

That last one seems to be gaining popularity.

--
Grant Edwards grante Yow! PEGGY FLEMING is
at stealing BASKET BALLS to
visi.com feed the babies in VERMONT.
.



Relevant Pages

  • Re: calling command line programs?
    ... >> This is probably a very newbie question, but after searching ... >> google and docs @ python.org I can't find an answer, ... >> I'd like to call command-line functions from my python script ... > subprocess modules. ...
    (comp.lang.python)
  • Newbie question, I have seen create! what does it mean
    ... I have some newbie question, and I have been searching all over google ... instead of normal method ...
    (comp.lang.ruby)
  • Re: how restrict recipients addresses on backup mailserver
    ... List of valid recipients ... dnl it stops looping in virtusertable mapping if input and output ... There must have been some failure on Google site ... search right now, then same search returns 74 results, and searching ...
    (comp.mail.sendmail)
  • Re: how restrict recipients addresses on backup mailserver
    ... sendmail versions or at all. ... dnl it stops looping in virtusertable mapping if input and output ... There must have been some failure on Google site ... search right now, then same search returns 74 results, and searching ...
    (comp.mail.sendmail)
  • Re: trickler3103.exe
    ... It's hard to tell for sure what a file is by the file name, but searching ... If you still can't download it, some versions of windows will let you run ... google or download.com to find it]. ... > I cannot delete or uninstall it. ...
    (microsoft.public.security)