Hi,
I want to calculate the size of a file or a pickled object. So say if a file is 2Kb (displayed in Windows file explorer) then I want the same information be displayed in python too.
reasonfile = open('test.csv', 'r')
#----I don't know the command to calculate size of a file--
print "File size is ", filesize
PLUS
Is there any way I can calculate the size of a pickled object.
>>> pickleddictionary = cPickle.dumps(dictionary)
>>> pickleddictionary
"(dp1\nS'w'\nS'1'\ns."
#---Don't know the code to calculate size--------
I want to calculate the size of a file or a pickled object. So say if a file is 2Kb (displayed in Windows file explorer) then I want the same information be displayed in python too.
reasonfile = open('test.csv', 'r')
#----I don't know the command to calculate size of a file--
print "File size is ", filesize
PLUS
Is there any way I can calculate the size of a pickled object.
>>> pickleddictionary = cPickle.dumps(dictionary)
>>> pickleddictionary
"(dp1\nS'w'\nS'1'\ns."
#---Don't know the code to calculate size--------