473,387 Members | 1,504 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,387 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 1613
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.