I'm pretty sure one would do this using the os.plock(op) function, but I have no idea how. Also, if there's a better way, I'd be grateful to find out. Code snippets are very welcome.
- Python – Getting the class name of an instance
- Python – Convert bytes to a string
- Python – How to leave/exit/deactivate a Python virtualenv
- Python – Proper way to declare custom exceptions in modern Python
- Python – Why is reading lines from stdin much slower in C++ than Python
- Pythonic way to create a long multi-line string
- Python – Why is “1000000000000000 in range(1000000000000001)” so fast in Python 3