Reputation: 39
I want to define a function that takes a file name, and runs the file through some code. I have completed the latter part, but I'm stuck at the first part. Here is where I'm having trouble:
def function(inputfilename):
file = open("inputfilename","r")
example input and the error I get:
>>>function("file.csv")
FileNotFoundError: [Errno 2] No such file or directory: 'inputfilename'
How can I fix this?
Upvotes: 0
Views: 1001