tags:

views:

238

answers:

1

filename = fileobject.read()

i want to transfer/assign the whole data of a object within a file

+3  A: 

You are almost doing it correctly already; the code should read

filecontent = fileobject.read()

read() with no arguments will read the whole data, i.e. the whole file content. The file name has nothing to do with that.

Martin v. Löwis