17 th exercise in python3, line 8 -10
we could do these two on one line, how?
in_file = open(from_file)
indata = in_file.read()
this was the question, so i do it in one step
indata = open(from_file,‘r’)
17 th exercise in python3, line 8 -10
in_file = open(from_file)
indata = in_file.read()
this was the question, so i do it in one step
indata = open(from_file,‘r’)
indata = open(from_file,‘r’)
I don’t think you have actually read the file you’ve opened. ‘r’ sets the opened file ready for reading at the beginning of the file. You need to call a .read() function on it.
indata = open(from_file).read()