Re: New line conversion with Popen attached to a pty

2013-06-21 Thread Dave Angel
On 06/20/2013 06:20 AM, Jonathan Harden wrote: Hi, We have a class which executes external processes in a controlled environment and does "things" specified by the client program with each line of output. To do this we have been attaching stdout from the subprocess.Popen to a pseudo terminal (

Re: New line conversion with Popen attached to a pty

2013-06-21 Thread jfharden
On Thursday, 20 June 2013 11:20:20 UTC+1, Jonathan Harden wrote: > ...SNIP > Sorry about the second post, it took a very long time to show up, long enough I thought it had been lost. -- http://mail.python.org/mailman/listinfo/python-list

Re: New line conversion with Popen attached to a pty

2013-06-21 Thread jfharden
On Thursday, 20 June 2013 23:04:39 UTC+1, Peter Otten wrote: > (2) Fiddle with terminal options, e. g. > > attrs = termios.tcgetattr(outSlave) > attrs[1] = attrs[1] & (~termios.ONLCR) | termios.ONLRET > termios.tcsetattr(outSlave, termios.TCSANOW, attrs) > > p = subprocess.Pop

Re: New line conversion with Popen attached to a pty

2013-06-20 Thread Peter Otten
jfhar...@gmail.com wrote: > Hi, > > Sorry if this appears twice, I sent it to the mailing list earlier and the > mail seems to have been swallowed by the black hole of email vagaries. > > We have a class which executes external processes in a controlled > environment and does "things" specified

Re: new line

2005-08-31 Thread Kuljo
Kuljo wrote: > Kuljo wrote: > >> Dear friends >> I'm so sorry to bore you with this trivial problem. Allthou: I have >> string having 0x0a as new line, but I should have \n instead. >> How should I solve it? >> I've tried >text_new=tex_old.replace(str(0x0a), '\n') >> and other things, but non

Re: new line

2005-08-29 Thread Peter Hansen
Kuljo wrote: > Kuljo wrote: >>I'm so sorry to bore you with this trivial problem. Allthou: I have string >>having 0x0a as new line, but I should have \n instead. > I have found this in the meantime: nl="\\"+"n" Note: this is unnecessary. You could just do nl='\\n' instead, and you don't nee

Re: new line

2005-08-29 Thread Kuljo
Kuljo wrote: > Dear friends > I'm so sorry to bore you with this trivial problem. Allthou: I have string > having 0x0a as new line, but I should have \n instead. > How should I solve it? > I've tried text_new=tex_old.replace(str(0x0a), '\n') > and other things, but none of them worked. > Thank

Re: new line

2005-08-29 Thread Robert Kern
Kuljo wrote: > Dear friends > I'm so sorry to bore you with this trivial problem. Allthou: I have string > having 0x0a as new line, but I should have \n instead. In [9]: '\x0a' Out[9]: '\n' They're the same thing. -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows hi

Re: new line

2005-08-29 Thread Claudio Grondi
"Kuljo" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Dear friends > I'm so sorry to bore you with this trivial problem. Allthou: I have string > having 0x0a as new line, but I should have \n instead. > How should I solve it? > I've tried > >>>text_new=tex_old.replace(str(0x0a

Re: New line

2005-04-21 Thread Dan
On Thu, 21 Apr 2005 21:34:03 +0100, "ionic" <[EMAIL PROTECTED]> wrote: Open a text editor and write your code. Save the file with a .py extension, i.e., myprogram.py. From the command line type 'python myfile.py' Dan > >Ok sorry guys, > >using the python gui, if i hit the 'enter' key python ju

Re: New line

2005-04-21 Thread Esben Pedersen
ionic wrote: Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. try shift + enter /Esben -- http://mail.python.org/mailman/listinfo/python-list

Re: New line

2005-04-21 Thread ionic
Got it now thanks all -- "It's all in fun or life isn't worth it!" "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > okay, you type your code in idle, and run your code by hitting the F5 > key? > -- http://mail.python.org/mailman/listinfo/python-list

Re: New line

2005-04-21 Thread Brian van den Broek
ionic said unto the world upon 2005-04-21 16:34: Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. How do i type several lines without executing after each line? Cheers A bit more precision in your question

Re: New line

2005-04-21 Thread [EMAIL PROTECTED]
okay, you type your code in idle, and run your code by hitting the F5 key? -- http://mail.python.org/mailman/listinfo/python-list

Re: New line

2005-04-21 Thread ionic
Ok sorry guys, using the python gui, if i hit the 'enter' key python just executes what ever ive typed. It doesnt take me to the next line. How do i type several lines without executing after each line? Cheers -- "It's all in fun or life isn't worth it!" "James Stroud" <[EMAIL PROTECTED]> w

Re: New line

2005-04-21 Thread Fredrik Lundh
"ionic" wrote: This is probably going to sound very dull but, how do you get to the next line after youve finished typing the first line? Thanks in advance if you don't know how to get a new line, how did you write that message? -- http://mail.python.org/mailman/listinfo/python-list

Re: New line

2005-04-21 Thread James Stroud
In the absence of any context to this question: Hit the button that says "Enter". James On Thursday 21 April 2005 01:15 pm, ionic wrote: > Hi all > > This is probably going to sound very dull but, how do you get to the next > line after youve finished typing the first line? > > Thanks in advance