473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

piping a stream to a python script


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:py*****************@python.org?subject=uns ubscribe>

(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 ma********@utoronto.ca
History Department, University of Toronto
(416) 978-2094
--------------------------------------------

please don't use the following addresses: ze**@derailleur.org
aa******@derailleur.org
Jul 18 '05 #1
2 1611
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
Jul 18 '05 #2
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 ma********@utoronto.ca
History Department, University of Toronto
(416) 978-2094
--------------------------------------------

please don't use the following addresses: ze**@derailleur.org
aa******@derailleur.org
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Christian Long | last post by:
Hi I'm trying to pipe data into a python program on Windows 2000, on the command line. Like this: dir | myProgram.py Here's what I tried:
2
by: Csaba Henk | last post by:
For me, one reason for using Python is that with the help of it I can rid of several problems that I faced with during writing scripts in Bourneish shells. Biggest of these problem was the...
2
by: Steve | last post by:
Hi, I want to know if I can 'pipe' output from a program into a python script. Is that possible? I need to pipe some output at runtime from a program written in C and I want to parse it/use it...
7
by: Edward Diener | last post by:
From within a function in my own module I need to take the output from a Python module "A", which is sending data to stdout and which can not be changed and which I need to invoke as a top-level...
0
by: Matt Price | last post by:
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...
5
by: runes | last post by:
I trying to figure out a way to make a python script accept data output from another process under Windows XP, but I fail miserably. I have a vague memory having read this is not possible with...
2
by: Apple Grew | last post by:
I want to develope a Winboard like application which will support Winboard protocol. For that I require to know how to handle piping in Python. I seperated out module popen2, but when I use...
6
by: mhenry1384 | last post by:
On WinXP, I am doing this nant.exe | python MyFilter.py This command always returns 0 (success) because MyFilter.py always succeeds. MyFilter.py looks like this while 1:
1
by: saibotorama | last post by:
What is the Python translation for this Bash statement: tar cf - "${files}" | bzip2 "$file".tar.bz2 (Ignoring the fact that "tar cjf" also exists...) In other words, how does one pipe...
2
by: robert | last post by:
I played around trying to encrypt/decrypt data through GPG on the fly (or worse - by using a file) (on Windows first - later to try on Linux too) Using os.popen3 like hangs on o.read or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.