I just started programming in python yesterday.
Ultimately I want to open a comma deliminated file and read its contents. I searched for related topics and tried using some of the code and am running into some errors.
Code:
def ReadTxtFile():
fname="c:\vba\lapseC2.csv"
#with open(fname) as f:
with open("c:\vba\lapseC2.csv", "r") as f:
content = f.readlines
you may also want to remove whitespace characters like \n
at the end of each line
content = [x.strip() for x in content]
ReadTxtFile()
Error:
OSError: [Errno 22] Invalid argument: 'c:\x0bba\lapseC2.csv'