# Write a Python program to get the file size of a plain file import os file= input("Enter file name: ") try: with open(file) as f: size=os.path.getsize(f) print("File Size is :",f, "bytes") except: print('File cannot be opened:', file)
Exception has occurred: TypeError stat: path should be string, bytes, os.PathLike or integer, not TextIOWrapper
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)