At 04:29 PM 5/15/2005, Danny Yoo wrote:
> > clamav.fromchild.close
> ^^
>Careful: you may need parens there on your 'close' line. (clothesline?
>*grin*)
>
>As written, that last statement doesn't fire off the close() method.
>This might be suprising because some other languag
> Here is what the code I settled on looks like:
>
> ###
> working = email.message_from_file(open(emailfile))
>
> clamav = popen2.Popen3(clamav_cmd,1)
> clamav.tochild.write(working.as_string())
> clamav.tochild.close()
> clamav_result = clamav.fromchild.read().lstrip('stream: ')
> clamav.fromchi
At 04:17 PM 5/13/2005, Alan Gauld wrote:
>AS a general pont all uppercase usually means a consrtant in Python.
>Variable names typically start lowercase and either use capital
>letters to separate words likeThis, or use underscores like_this.
>
>Variables starting with an uppercase letter tend to i
> http://www.ruby-talk.org/cgi-bin/scat.rb/ruby/ruby-talk/68786
> As a work around, I end up calling popen3 like this:
>
> Open3.popen3 ("/some/command/to/run ; echo $? 1>&2") { ... }
>
> That ensures the exit code from /some/command/to/run will be the last
> line of the standard error stream from
At 11:56 AM 5/12/2005, Danny Yoo wrote:
>* * * *
>CLAMAV_out, CLAMAV_in, CLAMAV_err= popen2.popen3(CLAMAV)
>CLAMAV_in.write(WORKING)
>CLAMAV_in.close()
>CLAM_RESULT=CLAMAV_out.read()
>CLAMAV_out.close()
>CLAM_ERR=CLAMAV_err.read()
>CLAMAV_err.close()
>* * * *
>
>CLAM_RESULT gives the correct reply
-- Forwarded message --
Date: Thu, 12 May 2005 11:31:57 -0600
From: Jeffrey Rice <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Pipe variable to external command
At 12:16 AM 5/12/2005, Danny Yoo wrote:
>##
> >>> c
On Wed, 11 May 2005, Jeffrey Rice wrote:
> I am having a little problem with how to pipe a variable's contents to an
> external command. Essentially, I have a variable that contains the
> contents of a variable that I want to feed to a series of external commands
> (clamav and spamassassin).
Hi,
I am working on getting comfortable with Python, and am trying to rewrite
some of my old (clumsy) bash scripts into python.
I am having a little problem with how to pipe a variable's contents to an
external command. Essentially, I have a variable that contains the
contents of a variable t