Skip to content
Snippets Groups Projects
Commit ece751d9 authored by Tommi Penttinen's avatar Tommi Penttinen
Browse files

Thin Python server to be used with websocketd

parents
No related branches found
No related tags found
No related merge requests found
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment