Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python3
- # -*- coding: utf-8 -*-
- import subprocess
- # why is this not executed immediately?
- lpr = subprocess.Popen("/usr/bin/lpr", # on raspbian: /usr/bin/lp
- stdin=subprocess.PIPE,
- stdout=subprocess.DEVNULL, # proposed by user elias
- close_fds=True) # proposed by user elias
- output = "Username: testusern".encode()
- + "Password: p4ssw0rdn".encode()
- lpr.stdin.write(output)
- while True:
- pass
- #! /usr/bin/env python3
- # -*- coding: utf-8 -*-
- import subprocess
- import time
- # why is this not executed immediately?
- lpr = subprocess.Popen("/usr/bin/lpr", # on raspbian: /usr/bin/lp
- stdin=subprocess.PIPE,
- stdout=subprocess.DEVNULL, # proposed by user elias
- close_fds=True) # proposed by user elias
- output = "Username: testusern".encode()
- + "Password: p4ssw0rdn".encode()
- lpr.stdin.write(output)
- time.sleep(20)
Add Comment
Please, Sign In to add comment