Website hosting service by

 Back to Index

5.20.1 Module Contents

The shlex module defines the following functions:

split( s[, comments=False])
Split the string s using shell-like syntax. If comments is False, the parsing of comments in the given string will be disabled (setting the commenters member of the shlex instance to the empty string). This function operates in POSIX mode. New in version 2.3.

The shlex module defines the following classes:


class shlex( [instream=sys.stdin[, infile=None[, posix=False]]])
A shlex instance or subclass instance is a lexical analyzer object. The initialization argument, if present, specifies where to read characters from. It must be a file-/stream-like object with read() and readline() methods, or a string (strings are accepted since Python 2.3). If no argument is given, input will be taken from sys.stdin. The second optional argument is a filename string, which sets the initial value of the infile member. If the instream argument is omitted or equal to sys.stdin, this second argument defaults to ``stdin''. The posix argument was introduced in Python 2.3, and defines the operational mode. When posix is not true (default), the shlex instance will operate in compatibility mode. When operating in POSIX mode, shlex will try to be as close as possible to the POSIX shell parsing rules. See 5.20.2.



2002-2004 Webhosting Service


Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to


Domain registration : Buy domain name or register domain name from $5.95/year only


Cheap domain registration : Register domain name or buy domain name, including free domain hosting services offers cheap domain registration, domain name transfer and domain search services