[Python-de] system und StringIO
Roland M. Kruggel
rk.liste at bbf7.de
Son Apr 23 22:14:32 CEST 2006
Am Sonntag, 23. April 2006 20:53 schrieb Andreas Jung:
> --On 23. April 2006 20:43:54 +0200 "Roland M. Kruggel"
> <rk.liste at bbf7.de>
>
> wrote:
> > Hallo Liste,
> >
> > ich benötige die Ausgabe eines Programmes in einem Python
> > Programm.
> >
> > Meine momentane Lösung (kurzfassung):
> >
> > os.system('progname > /tmp/file')
> > f = open('/tmp/file','r')
> > for line in f.readline()
> > ...
>
> -> process Module
> -> commands Module
Das war's. Genau was ich gesucht habe.
commands.getoutput(progname).split()[0]
Danke schön
--
cu
Roland Kruggel mailto: rk.liste at bbf7.de
System: Intel, Debian etch, 2.6.15, KDE 3.5