Let me begin by saying that I'm new to Python and to PyCharm. I'm using Python 3.3.3 and PyCharm 3.0.2 CE on Mac OS X Mavericks. I have a text file that I would like to read line by line. The file itself can be very large at times. Of course I've researched as much as I can using all the familiar search engines with no luck before creating this post. This is how I'm trying to reference the file I wish to read line by line:
text_file = os.path.isfile("/<user>/Documents/my_file.txt")
#do something to each line in the text file
I get the following error message:
FileNotFoundError: [Errno 2] No such file or directory: '/<user>/Documents/my_file.txt'
Could anyone recommend the proper method I should use to read a text file line by line I'm referencing in PyCharm? I apologize if a previous post has been created asking the same question. Any suggestions would be helpful. Thank you!