The name parm to open can be a variable so:
fname = input('File to open ')
f = open(fname, 'w')
solved How to set a file name with a variable
The name parm to open can be a variable so:
fname = input('File to open ')
f = open(fname, 'w')
solved How to set a file name with a variable