Hello [member=6850]colin[/member] ,
it looks like you are running the file incorrectly as you are not specifying the command in terminal.
I do not have the Python3 book only the Python2, I had a try at this one though to help
.
The Python, notice the line changes and indentations.
![[Image: colin1.png]](https://preview.ibb.co/bCMiHU/colin1.png)
The test.txt file used (contents are his words not mine) from an exercise in the Python2 book, I just renamed it to use for this try.
![[Image: colin2.png]](https://preview.ibb.co/nsUW49/colin2.png)
How to run it in terminal
![[Image: colin3.png]](https://preview.ibb.co/irRYHU/colin3.png)
On highlight in terminal see #1, #2 and #3 above, these are the components of the command that you need.
For #2 you can either cd to the directory containing your Python files, or you can enter in your Path as previously. I just put it in Home directory as its temporary for this post.
#3 is what you have missed in the terminal command ? or it is in another folder than the Python file is.
it looks like you are running the file incorrectly as you are not specifying the command in terminal.
I do not have the Python3 book only the Python2, I had a try at this one though to help

The Python, notice the line changes and indentations.
![[Image: colin1.png]](https://preview.ibb.co/bCMiHU/colin1.png)
The test.txt file used (contents are his words not mine) from an exercise in the Python2 book, I just renamed it to use for this try.
![[Image: colin2.png]](https://preview.ibb.co/nsUW49/colin2.png)
How to run it in terminal
![[Image: colin3.png]](https://preview.ibb.co/irRYHU/colin3.png)
On highlight in terminal see #1, #2 and #3 above, these are the components of the command that you need.
For #2 you can either cd to the directory containing your Python files, or you can enter in your Path as previously. I just put it in Home directory as its temporary for this post.
#3 is what you have missed in the terminal command ? or it is in another folder than the Python file is.