Advertisement
cooperlees

Untitled

Jul 8th, 2019
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. cooper@us:~/repos$ /opt/venvs/eb/bin/python3.7 example_with_fifos.py
  2. exabgp 4.1.0-2074ac17
  3. done
  4.  
  5. cooper@us:~/repos$ sudo /opt/venvs/eb/bin/python3.7 example_with_fifos.py
  6. exabgp 4.1.0-2074ac17
  7. done
  8.  
  9. Code:
  10. cooper@us:~/repos$ cat example_with_fifos.py
  11. #!/usr/bin/env python3
  12.  
  13. from pathlib import Path
  14.  
  15. IN_FILE = Path("/run/exabgp.in")
  16. OUT_FILE = Path("/run/exabgp.out")
  17.  
  18. cmd = "version\n"
  19.  
  20. with IN_FILE.open("w") as infp:
  21.         infp.write(cmd)
  22.  
  23. with OUT_FILE.open("r") as outfp:
  24.         print(outfp.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement