piping a stream to a python script

M

Matt Price

Hi folks,

I'm writing a python script which I plan to use in a macro for mutt,
the mailer. The script is supposed to generate and send an email
based on a mailto: url pulled out of an email header. The header will
be passed to the script in the following form, using a pipe:

<http://mail.python.org/mailman/listinfo/python-list>,
<mailto:p[email protected]?subject=unsubscribe>

(the mutt macro looks like this:
| formail -x List-Unsubscribe: | /usr/local/scripts/mailout.py )

I'd like to capture the stream in a string object. Is there a simle
way to do this?

Thanks much,

Matt
 
M

Maciej Dziardziel

Matt said:
I'd like to capture the stream in a string object. Is there a simle
way to do this?

Just read read from sys.stdin.

--
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl

'Good manners will open doors that the best education cannot.' --
Clarence Thomas, U.S. Supreme Court Justice
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top