Re: Slurping All Content of a File into a Variable

2006-10-27 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > myfile_content is an object and you have only opened the file. Python > doesn't yet know whether you want to read it, copy it etc. > > to read it try > > text = myfile_content.readlines() > print text > > this should be in most tutoria

Re: Slurping All Content of a File into a Variable

2006-10-27 Thread marc . wyburn
myfile_content is an object and you have only opened the file. Python doesn't yet know whether you want to read it, copy it etc. to read it try text = myfile_content.readlines() print text this should be in most tutorials Wijaya Edward wrote: > Hi, > > How can we slurp content of a single fil

RE: Slurping All Content of a File into a Variable

2006-10-26 Thread Wijaya Edward
From: [EMAIL PROTECTED] on behalf of Wijaya Edward Sent: Thu 10/26/2006 11:47 PM To: python-list@python.org Subject: Slurping All Content of a File into a Variable Hi, How can we slurp content of a single file into one variable? I tried this

Slurping All Content of a File into a Variable

2006-10-26 Thread Wijaya Edward
Hi, How can we slurp content of a single file into one variable? I tried this: >>> myfile_content = open('somefile.txt') >>> print myfile_content, >>> But it doesn't print the content of the file. Regards, -- Edward WIJAYA SINGAPORE Institute For Infocomm Research - Dis