Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import os
- p = '/proc/pressure/memory'
- s = 'some 140000 1000000'
- try:
- fd1= os.open(p, os.O_RDWR | os.O_NONBLOCK, mode=0o777, dir_fd=None)
- print(fd)
- s2 = s.encode()
- print(type(s2), s2)
- n = os.write(fd1, s2)
- print(n)
- except Exception as e:
- print(e)
- finally:
- os.close(fd)
Advertisement
Add Comment
Please, Sign In to add comment