Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread Alan Gauld
"James" <[EMAIL PROTECTED]> wrote > Given this explanation, it's probably not a great idea to use > signal.signal() then. ;) I'm probabably painting too black a picture, its just that I've had problems using signal in the past. Where the signal is specific to a single process it should be OK. >

Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread James
Thanks for the response, Alan. Given this explanation, it's probably not a great idea to use signal.signal() then. ;) Any other thoughts? I've tried about redirecting my output using subprocess.Popen( ... , stdout=*something* ), but I haven't had much luck. The error still appears. Or s

Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread Alan Gauld
"James" <[EMAIL PROTECTED]> wrote > signal.signal(signal.SIGPIPE, signal.SIG_DFL) > > Before the snippet of code I included in my original e-mail > (subprocess.call( "yes '' | make oldconfig" , shell=True )) got rid > of the error. I can't seem to figure out precisely what the > signal.signal() f

Re: [Tutor] How to print a %-sign

2007-10-20 Thread Kent Johnson
Leon Hasbeck wrote: > Hi, > > I would like to give out a formatted string that includes a percent sign, > that > is not used as formatting sign.Example: > > print "Your chance to win is %4.2f %" %p Just double the %: print "Your chance to win is %4.2f %%" %p Kent > > This doesn't work, beca

Re: [Tutor] upgrading Python

2007-10-20 Thread Kent Johnson
LandSurveyor wrote: > If I could be so bold...as to return for a moment to my long since buried > question: What happened to the once pleasant relation between Python & > digraphs. Given that digraphs are a form offered by Vim (not intrinsic to > Python[?]), they worked when I was using Python

[Tutor] How to print a %-sign

2007-10-20 Thread Leon Hasbeck
Hi, I would like to give out a formatted string that includes a percent sign, that is not used as formatting sign.Example: print "Your chance to win is %4.2f %" %p This doesn't work, because the last %-sign is interpreted as formatting sign and thus leads to an error message. I tried \x25 in

Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread James
It seems that adding this line: signal.signal(signal.SIGPIPE, signal.SIG_DFL) Before the snippet of code I included in my original e-mail (subprocess.call( "yes '' | make oldconfig" , shell=True )) got rid of the error. I can't seem to figure out precisely what the signal.signal() function

[Tutor] upgrading Python

2007-10-20 Thread LandSurveyor
If I could be so bold...as to return for a moment to my long since buried question: What happened to the once pleasant relation between Python & digraphs. Given that digraphs are a form offered by Vim (not intrinsic to Python[?]), they worked when I was using Python 2.3. Now, with the upgrade

Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread Martin Walsh
James wrote: > Hi, > > I have a snippet of code in a Python script I'm whipping up that's > causing a not-so-pretty output. Here's the code: > > subprocess.call( "yes '' | make oldconfig" , shell=True ) > > When I run this code, Python loyally executes the command, and then I > see the foll

Re: [Tutor] "standard output: Broken pipe"

2007-10-20 Thread Alan Gauld
"James" <[EMAIL PROTECTED]> wrote in message > I have a snippet of code in a Python script I'm whipping up that's > causing a not-so-pretty output. Here's the code: > > subprocess.call( "yes '' | make oldconfig" , shell=True ) > - > yes: standard output: Broken pipe > yes: write error > -