Trying to load data/text file


I am trying to enter the code below from a really simple text file. As you can in the output below, it prints the first line of the file and stops before printing the other two lines. (The text file by the way is located with the working Pycharm file).

Any clues as to what I am doing wrong?





C:\Users\ahitc\PycharmProjects\Python revision\venv\Scripts\python.exe" "C:/Users/ahitc/PycharmProjects/Python revision/scratch.txt"
File "C:/Users/ahitc/PycharmProjects/Python revision/scratch.txt", line 1
first line of text
SyntaxError: invalid syntax

1 comment
Comment actions Permalink

Please try to run your code from the terminal outside of IDE to see if it's IDE's fault:

For more information on how to run your code from the terminal outside of IDE, please see the following article:

If you're using virtualenv interpreter in PyCharm, you may need to activate it in the command line as well:


Please sign in to leave a comment.