I need to know the size of the file based on file object
import csv
import os
with open("test.csv", "rb") as infile:
reader = csv.reader(infile)
print reader
filesize(reader)
def filesize(reader):
os.getsize(reader) #And i need work with reader for more details.so I must need to pass a reader or file object
When I run this I got an output is
<_csv.reader object at 0x7f5644584980>
From this file object how I get the size of the file?
And I checked this site but these are not CSV attribute size of an open file object
EDIT: When I use that two inbuilt function I got errors that are
AttributeError: '_csv.reader' object has no attribute 'seek' AttributeError: '_csv.reader' object has no attribute 'tell'