Created
October 5, 2015 15:48
-
-
Save xavismeh/bd0c3073021c8427a062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
filename = 'my_file.txt' | |
filesize = os.path.getsize(filename) | |
b_read = 0 | |
f = open(filename, 'r') | |
# read n bytes and perform action | |
# ... | |
b_read += n | |
print b_read*100/filesize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment