Added python

Also updated Makefile for ease of use.
This commit is contained in:
stickynotememo
2025-12-19 18:13:45 +11:00
parent 806ff9ce43
commit 3f478d3b96
5 changed files with 60 additions and 35 deletions
+21
View File
@@ -0,0 +1,21 @@
# adapted from https://stackoverflow.com/a
# Retrieved 2025-12-19, License - CC BY-SA 3.0
import os
import errno
try:
os.mkfifo('chinese_whispers_pipe')
except OSError as oe:
if oe.errno != errno.EEXIST:
raise
os.system("./target/3_rust &"); # Run 3_rust in background to start writing to pipe
with open('chinese_whispers_pipe') as fifo:
data = fifo.read()
print(data + "\nHello from Python.")