crackanddie

Python example for pi-blaster

Nov 6th, 2021 (edited)
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. def echo_to_file(st: str):
  2.     original_stdout = sys.stdout
  3.     with open('/dev/pi-blaster', 'w') as f:
  4.         sys.stdout = f  # Change the standard output to the file we created.
  5.         print(st)
  6.         sys.stdout = original_stdout  # Reset the standard output to its original value
Add Comment
Please, Sign In to add comment