Jan-19-2018, 02:44 AM
I've just taken up coding and have been teaching myself out of Simon Monk's "Programming the Raspberry Pi" book. On p79, he demonstrates how to write a file in the python shell. When I copy his code into my shell, instead of writing a file, it gives me the length of the string I tried to write.
I've tried different files, different variable names, restarting python, and trying different strings, but it's always the same result. I'm running python 3 on Raspbian.
My shell looks like this:
[email protected]
I've tried different files, different variable names, restarting python, and trying different strings, but it's always the same result. I'm running python 3 on Raspbian.
My shell looks like this:
>>> f = open('test.txt', 'w') >>> f.write('words') 5 >>>hoping you can help
[email protected]