The shlex module

This module provides a simple lexer (also known as tokenizer) for languages based on the Unix shell syntax.

Example: Using the shlex module
# File:

import shlex

lexer = shlex.shlex(open("samples/sample.netrc", "r"))
lexer.wordchars = lexer.wordchars + "._"

while 1:
    token = lexer.get_token()
    if not token:
    print repr(token)


A Django site. rendered by a django application. hosted by webfaction.