I want to change the built-in file I/O methods for any given python application without having to modify its code. Is this possible?
Maybe using Python's subprocess
?
For example, I want a file object's read()
method to actually call my custom_read()
method instead, but without having to change any code in the program calling the read()
.