New to Python - Easy way to open a text file

skip at pobox.com skip at pobox.com
Fri Mar 30 12:05:06 EDT 2007


    Max> Hey gang, I'm new to python coding.  I'm trying to find the
    Max> simplest way to open a text file (on the same server) and display
    Max> it's content.

Try the open() builtin function:

    f = open(plainfiles.href, "r")
    print f.read()

Skip



More information about the Python-list mailing list