Re: Parsing a commandline from within Python

2007-10-11 Thread Steven Bethard
[EMAIL PROTECTED] wrote:
 Is there any buildin function which mimics the behavior of the
 standard commandline parser (generating a list of strings
 foo bar and some text from the commandline
 foo bar some text)?

Try the shlex module::

  import shlex
  shlex.split('foo bar some text')
 ['foo bar', 'some text']

STeVe
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Parsing a commandline from within Python

2007-10-11 Thread Andreas Huesgen

 Is there any buildin function which mimics the behavior of the
 standard commandline parser (generating a list of strings
 foo bar and some text from the commandline
 foo bar some text)?
 
 Try the shlex module::
 
   import shlex
   shlex.split('foo bar some text')
  ['foo bar', 'some text']
 

Thanks, that is exactly what i need.


Andreas Huesgen
-- 
http://mail.python.org/mailman/listinfo/python-list