Perl-like backtick in Python

Noah Spurrier noah at noah.org
Fri May 3 11:05:38 EDT 2002


popen()  opens a pipe (pipe open = popen).

For some reason I prefer this syntax to commands.getoutput
(mostly because I always forget it's there).

Yours,

Noah

----- Original Message -----
From: "Tom Verbeure" <tom_verbeure at hotmail.com>
Newsgroups: comp.lang.python
To: <python-list at python.org>
Sent: Friday, May 03, 2002 4:22 AM
Subject: Re: Perl-like backtick in Python


> Ok, now I see. I mistakenly assumed that this would involve pipes and
such.
>
> Thanks!
> Tom
>
>
> > > That would be very ugly, wouldn't it?
> >
> > Uh, why?
> >
> >  lines = os.popen("ls -l").readlines()
>






More information about the Python-list mailing list