mirror of
https://github.com/projectPiki/pikmin2.git
synced 2025-03-09 00:41:11 +00:00
added print statements
This commit is contained in:
parent
9e73e99990
commit
3b031547b8
@ -209,8 +209,9 @@ if __name__ == "__main__":
|
||||
with open(CSV_FILE_PATH, 'r') as file:
|
||||
reader = csv.reader(file)
|
||||
does_file_exist = True
|
||||
print(f"Successfully read {CSV_FILE_PATH}!")
|
||||
except:
|
||||
print('CSV file does not exist!')
|
||||
print(f'Failed to read {CSV_FILE_PATH}!')
|
||||
|
||||
col_one = f"code_count_in_{CODE_ITEM.lower()}"
|
||||
col_two = "code_completion_in_bytes"
|
||||
@ -231,17 +232,23 @@ if __name__ == "__main__":
|
||||
col_eight,
|
||||
]
|
||||
|
||||
with open(CSV_FILE_PATH, 'a', newline='') as file:
|
||||
writer = csv.DictWriter(file, fieldnames=headers)
|
||||
if not does_file_exist:
|
||||
writer.writeheader()
|
||||
writer.writerow({
|
||||
col_one: codeCount,
|
||||
col_two: decomp_code_size,
|
||||
col_three: codeCompletionPcnt,
|
||||
col_four: dataCount,
|
||||
col_five: decomp_data_size,
|
||||
col_six: dataCompletionPcnt,
|
||||
col_seven: sentence,
|
||||
col_eight: datetime.now(),
|
||||
})
|
||||
try:
|
||||
with open(CSV_FILE_PATH, 'a', newline='') as file:
|
||||
writer = csv.DictWriter(file, fieldnames=headers)
|
||||
if not does_file_exist:
|
||||
writer.writeheader()
|
||||
writer.writerow({
|
||||
col_one: codeCount,
|
||||
col_two: decomp_code_size,
|
||||
col_three: codeCompletionPcnt,
|
||||
col_four: dataCount,
|
||||
col_five: decomp_data_size,
|
||||
col_six: dataCompletionPcnt,
|
||||
col_seven: sentence,
|
||||
col_eight: datetime.now(),
|
||||
})
|
||||
print(f"Successfully wrote to {CSV_FILE_PATH}!")
|
||||
except:
|
||||
print(f"Failed to write to {CSV_FILE_PATH}!")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user