I am new to python and reckon I'm doing something wrong while trying to access a variable file(text file) from a variable directory. The code that I've written is:
filename = input('Enter filename')
dir = input('Enter directory')
with open('%s/%s.txt' %dir % filename,'r') as myfile:
input = myfile.read().replace('\n','')
But I'm unable to access the file due to error which says:
TypeError: not enough arguments for format string
Can anyone help me in this?