[Tutor] os.popen
Klas Marteleur
klas.martelleur at telia.com
Sun Nov 28 17:46:56 CET 2004
Hi
I have a little problem that is confusing me.
If i write the following in a bash shell i get the desired output:
[klas at h180n2fls32o849 klas]$ kwrite -v
Qt: 3.2.3
KDE: 3.2 BRANCH >= 20040204
KWrite: 4.2
It also works in a python shell...
>>> os.popen("kwrite -v").readlines()
['Qt: 3.2.3\n', 'KDE: 3.2 BRANCH >= 20040204\n', 'KWrite: 4.2\n']
If i try the following in a bash shell, it also workes:
[klas at h180n2fls32o849 klas]$ tccat -v
tccat (transcode v0.6.12) (C) 2001-2003 Thomas Oestreich
But if i try the same in a python shell i get:
>>> os.popen("tccat -v").readlines()
[]
Not even if i specify the path it works.
>>> os.popen("/usr/bin/tccat -v").readlines()
[]
What am i missing?
Kind Regards
Klas
More information about the Tutor
mailing list