Re: Entering strings as user input but interpreting as Python input (sort of)

2007-09-17 Thread Gabriel Genellina
En Mon, 17 Sep 2007 21:01:38 -0300, Chris Carlen <[EMAIL PROTECTED]> escribi�: > I'm writing a Python program, a hex line editor, which takes in a line > of input from the user such as: > > >>> cmd = raw_input('-').split() > -e 01 02 "abc def" 03 04 > >>> cmd > ['e', '01', '02', '"abc', 'def"'

Entering strings as user input but interpreting as Python input (sort of)

2007-09-17 Thread Chris Carlen
Hi: I'm writing a Python program, a hex line editor, which takes in a line of input from the user such as: >>> cmd = raw_input('-').split() -e 01 02 "abc def" 03 04 >>> cmd ['e', '01', '02', '"abc', 'def"', '03', '04'] Trouble is, I don't want to split the quoted part where the space occurs.