-
-
Save zeffii/8153916 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
# file_size_tester.py | |
import os | |
import time | |
#from json_writer import write_full_json | |
#while(true) | |
def test_size(full_path_to_file, predicted_size): | |
while(True): | |
try: | |
stats = os.stat(full_path_to_file) | |
found_size = stats.st_size | |
print(found_size) | |
if found_size > 0: | |
percent = float(found_size)/float(predicted_size) | |
# write_full_json(0, wav_name, "wav", percent) | |
print("percet:", percent) | |
if found_size >= predicted_size: | |
break | |
except: | |
print("not found yet") | |
time.sleep(1.0) | |
pass | |
time.sleep(2.0) | |
print("done!!") | |
full_path_to_file = "C:/Users/dealga/Desktop/code/interesting.txt" | |
test_size(full_path_to_file, 45) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment