piping a stream to a python script

Discussion in 'Python' started by Matt Price, Oct 27, 2004.

  1. Matt Price

    Matt Price Guest

    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?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
    History Department, University of Toronto
    (416) 978-2094
    --------------------------------------------

    please don't use the following addresses:
     
    Matt Price, Oct 27, 2004
    #1
    1. Advertisements

  2. 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
     
    Maciej Dziardziel, Oct 27, 2004
    #2
    1. Advertisements

  3. Matt Price

    Matt Price Guest

    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
    History Department, University of Toronto
    (416) 978-2094
    --------------------------------------------

    please don't use the following addresses:
     
    Matt Price, Oct 28, 2004
    #3
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian Long
    Replies:
    3
    Views:
    10,823
    Duncan Booth
    Jun 26, 2003
  2. Michael Lehmeier
    Replies:
    11
    Views:
    769
    Donn Cave
    Oct 27, 2003
  3. Matt Price

    piping a stream to a python script

    Matt Price, Oct 27, 2004, in forum: Python
    Replies:
    0
    Views:
    373
    Matt Price
    Oct 27, 2004
  4. runes
    Replies:
    5
    Views:
    674
    runes
    Apr 16, 2005
  5. mhenry1384
    Replies:
    6
    Views:
    1,024
    chris
    Aug 17, 2005
  6. robert

    piping data stream through GPG

    robert, Jun 9, 2007, in forum: Python
    Replies:
    2
    Views:
    487
    robert
    Jun 9, 2007
  7. Donn Ingle

    piping into a python script

    Donn Ingle, Jan 24, 2008, in forum: Python
    Replies:
    16
    Views:
    895
    anonymous
    Feb 1, 2008
  8. Tim Arnold

    piping input to an external script

    Tim Arnold, May 11, 2009, in forum: Python
    Replies:
    9
    Views:
    422
    Steve Howell
    May 12, 2009
Loading...