Python text parsing and field delimiters.?

I have a Python script that is reading URLs from a text file. Some of the URLs will need usernames & passwords. What is the best way to delimit and read the different fields in Python? I need something that can handle delimiter characters inside the URL or password field.

Thanks!

rich2009-02-10T03:24:31Z

Favorite Answer

Use the Python CSV module:
http://docs.python.org/library/csv.html

CSV files are usually delimited by comma, but this module can handle if the delimiter is in the tokens.
CSV files can also be open up be excel.