[Pythonmac-SIG] Popen2
Francois Granger
postmaster at fgranger.com
Tue Dec 28 19:27:24 CET 2004
I am trying to use popen2.popen3 and I am stuck.
I tested the command line I am building and it works ok. This may be due to
my lack of knowledge of the command line functionnalities... But this script
either hang or raise an error.
This is the bare bone script directly copied from the sample:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""r, w, e = popen2.popen3('python slave.py')
e.readlines()
r.readlines()
r.close()
e.close()
w.close()"""
import popen2
theString = file('testfiles/notes.htm').read()
source = 'macintosh'
target = 'UTF-8'
r, w, e = popen2.popen3('iconv -f ' + source.upper() + ' -t ' +
target.upper() + '//TRANSLIT')
w.write(theString)
e.readlines()
result = r.readlines()
r.close()
e.close()
w.close()
print result
pass
More information about the Pythonmac-SIG
mailing list