Sure. Assuming you have a string with the file’s name called fname
, the following does the trick.
with open(fname, 'r') as fin:
print(fin.read())
Sure. Assuming you have a string with the file’s name called fname
, the following does the trick.
with open(fname, 'r') as fin:
print(fin.read())