Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def echo_to_file(st: str):
- original_stdout = sys.stdout
- with open('/dev/pi-blaster', 'w') as f:
- sys.stdout = f # Change the standard output to the file we created.
- print(st)
- sys.stdout = original_stdout # Reset the standard output to its original value
Add Comment
Please, Sign In to add comment