[Tutor] using subprocess to export files in bash

Rogelio scubacuda at gmail.com
Wed May 9 01:37:53 CEST 2012


On Tue, May 8, 2012 at 11:06 AM, David Abbott <david at pythontoo.com> wrote:

> I have used this before;
>
> def uptime_report():
>    """Generate uptime"""
>    p = subprocess.Popen("uptime > /tmp/uptime.txt",
>            shell=True, stdout=subprocess.PIPE)
>    return p.stdout.readlines()
>
> That was from python 2.6

Looks like a lot of my problem is that my CentOS box had Python 2.4
defaulted.  Looks like Popen isn't working right, even with the most
simple examples.

(will look at this first before I bug everyone with this problem anymore)

Thanks for all your help, guys...


More information about the Tutor mailing list