ortug
07/07/2005, 11:22
Aşağıdaki adresteki 'Example 16.4. Running a program (3)' başlığı altındaki kodu telnet bağlantısı kurmak için denedim. Hata verince aşağıdaki kodu aynen kopyala yapıştır yaptığımda da aynı hatayı verdi. İşletim sistemin win xp.
child = popen2.Popen3(cmd) satırı için
'module' object has no attribute 'Popen3' hatasını veriyor.
python'da acemiyim. Yardımcı olursanız sevinirim
http://www.pasteur.fr/formation/infobio/python/ch16s02.html
import popen2
import os.path
cmd = "dnapars"
if os.path.exists('treefile'):
os.unlink('treefile')
if os.path.exists('outfile'):
os.unlink('outfile')
child = popen2.Popen3(cmd)
print "PID: ", child.pid
child.tochild.write("y\n")
child.tochild.close()
child.wait()
print "".join(child.fromchild.readlines())
status = child.fromchild.close()
if status is not None:
print "status: ", status
child = popen2.Popen3(cmd) satırı için
'module' object has no attribute 'Popen3' hatasını veriyor.
python'da acemiyim. Yardımcı olursanız sevinirim
http://www.pasteur.fr/formation/infobio/python/ch16s02.html
import popen2
import os.path
cmd = "dnapars"
if os.path.exists('treefile'):
os.unlink('treefile')
if os.path.exists('outfile'):
os.unlink('outfile')
child = popen2.Popen3(cmd)
print "PID: ", child.pid
child.tochild.write("y\n")
child.tochild.close()
child.wait()
print "".join(child.fromchild.readlines())
status = child.fromchild.close()
if status is not None:
print "status: ", status