popen(), sendmail: Success?

Thomas Guettler pan-newsreader at thomas-guettler.de
Thu Apr 10 17:50:37 EDT 2003


On Thu, 10 Apr 2003 22:57:17 +0200, Martin Bless wrote:


> To send mails from Python here's the example my provider provides: This
> http://faq.puretec.de/skripte/python/3.html
> 
> The relevant lines are these:
> 
> sendmail = os.popen("/usr/lib/sendmail -t", "w") sendmail.write(msg)
> sendmail.close()

popen can you give an stdout and stderr (Standard out/error) stream. Read
them after writing to stdin. Look at their content. I think if they are
empty all is fine. You can get the return value of the command with
wait(), too.

If you are using windows you can test popen with popen("dir").

  thomas




-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de




More information about the Python-list mailing list