Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > piping a stream to a python script

Reply
Thread Tools

piping a stream to a python script

 
 
Matt Price
Guest
Posts: n/a
 
      10-27-2004

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(E-Mail Removed)?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


-------------------------------------------
Matt Price http://www.velocityreviews.com/forums/(E-Mail Removed)
History Department, University of Toronto
(416) 978-2094
--------------------------------------------

please don't use the following addresses: (E-Mail Removed)
(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Maciej Dziardziel
Guest
Posts: n/a
 
      10-27-2004
Matt Price wrote:

> 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
 
Reply With Quote
 
 
 
 
Matt Price
Guest
Posts: n/a
 
      10-28-2004
On Thu, Oct 28, 2004 at 12:18:31AM +0200, Maciej Dziardziel wrote:
> Matt Price wrote:
>
> > 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.
>

thank you, sorry to be such a dope!
m


-------------------------------------------
Matt Price (E-Mail Removed)
History Department, University of Toronto
(416) 978-2094
--------------------------------------------

please don't use the following addresses: (E-Mail Removed)
(E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
piping into a python script Donn Ingle Python 16 02-01-2008 10:34 AM
piping data stream through GPG robert Python 2 06-09-2007 04:50 PM
get the return code when piping something to a python script? mhenry1384 Python 6 08-17-2005 02:23 PM
Piping data into script under Win32 runes Python 5 04-16-2005 03:52 AM
piping a stream to a python script Matt Price Python 0 10-27-2004 07:35 PM



Advertisments