We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

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: shlex-example-1.py

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)