Commit ece751d9 authored by Tommi Penttinen's avatar Tommi Penttinen
Browse files

Thin Python server to be used with websocketd

parents
#!/usr/bin/env python3
import datetime
import sys
def main():
output_file = sys.argv[1]
print(f"Saving output to {output_file}")
for line in sys.stdin:
print("Gotcha")
entry = f"{ line.strip() },{ datetime.datetime.now().isoformat() }"
with open(output_file, 'a') as f:
f.write(entry + '\n')
print(entry)
sys.stdout.flush()
if __name__ == '__main__':
main()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment