[Tutor] opening files

John Purser jmpurser at gmail.com
Mon Sep 25 21:14:50 CEST 2006


On Mon, 2006-09-25 at 12:55 -0600, max . wrote:
> hello i cant understand how to open text files with python
> i have tried tutorials and evrything i just cant get pleas help
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

Hello Max,

my_file = open('c:\\path\to\file\file.txt', 'r')
my_file.readlines()
my_file.close()

Really, it's so simple it's hard to come up with directions.  Just do
it.

John Purser



More information about the Tutor mailing list