Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os, commands
- def test_1():
- try:
- n = int(os.popen('pidof pigpiod').read().splitlines()[0])
- except:
- n = None
- return n
- def test_2():
- try:
- n = int(commands.getstatusoutput('pidof pigpiod')[1])
- except:
- n = None
- return n
- print "test 1: ", test_1()
- print "test 2: ", test_2()
- test 1: 2038
- test 2: 2038
- test 1: None
- test 2: None
Add Comment
Please, Sign In to add comment