Nov-07-2016, 10:09 PM
Say I open a file using
when I then type
the contents of the file are output.
However, if I open a file using
and then I type
nothing is output to the screen when I type
Why does
lookingatfile = open([i]filename[/i])when I then type
print lookingatfile.read()the contents of the file are output.
However, if I open a file using
lookingatfile = open([i]filename[/i])and then I type
x = lookingatfile.read()nothing is output to the screen when I type
print lookingatfile.read() and I only get text output to the screen when type print xWhy does
print lookingatfile.read() print nothing, once I've assigned it to a variable in the script (eg, using x = lookingatfile.read())? 