Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import subprocess
- class MyDisplay:
- def __init__( self ):
- self.value = 0
- self.proc = subprocess.Popen(
- ["./display_ctl"],
- stdout = subprocess.PIPE,
- stdin = subprocess.PIPE
- )
- def __del__(self):
- self.proc.terminate()
- def set_value( self, val ):
- self.value = val
- self.proc.stdin.write( str(val) + '\n')
- print 'Set value', val
- def get_value( self ):
- return self.value
- if __name__=="__main__":
- dev = MyDisplay()
- dev.set_value( 15 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement