Data Length
February 25, 2019
These few lines of code are useful to calculate the size of a file. Later, we'll combine it with another script.
from sys import argv
script, filename = argv
a1 = open(filename)
data = a1.read()
print "The size of the file is %r bytes." % len (data)
Related Entries
- String Length May 1, 2018
- Reading a Simple Text File with Python February 8, 2019
- Copying Files January 31, 2018