FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Unverified Commit d8511c33 authored by Rob Thompson's avatar Rob Thompson Committed by GitHub
Browse files

Update log_in.py

Lose the need for a header on this script's output. Put that in on the coordinating machine.
parent d66c984e
No related branches found
No related tags found
No related merge requests found
......@@ -6,26 +6,6 @@ import os
log_file_name = '/home/msm-class/attendance_log.csv'
#ensure the expected header lines are there:
if not os.path.isfile(log_file_name):
with open(log_file_name,'wt') as f:
f.write('mifare_id,datetime\n')
# Jankily check the header
with open(log_file_name,'rt') as f:
lines = f.readlines()
if len(lines) >= 1:
line = lines[0].strip()
else:
line = ''
# add the header if it is not there
if line != 'mifare_id,datetime':
lines = ['mifare_id,datetime\n'] + lines
with open(log_file_name,'wt') as f:
f.writelines(lines)
#set up the GUI
# Define the window's contents
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment