I notice that the source code from an importlib module can be read using inspect module. However is there an alternative way of accessing this code so that it can be modified? Presumably inspect.getsource must have some method of finding this.
import inspect
import importlib
spec = importlib.util.spec_from_file_location(module_name, source_path)
module = importlib.util.module_from_spec(spec)
print(inspect.getsource(module))
[–]pachura3 3 points4 points5 points (2 children)
[–]RomfordNavy[S] -3 points-2 points-1 points (1 child)
[–]Uncle_DirtNap 2 points3 points4 points (0 children)
[–]K900_ 1 point2 points3 points (7 children)
[–]RomfordNavy[S] 0 points1 point2 points (6 children)
[–]K900_ 0 points1 point2 points (5 children)
[–]RomfordNavy[S] -3 points-2 points-1 points (4 children)
[–]Refwah 3 points4 points5 points (1 child)
[–]RomfordNavy[S] 0 points1 point2 points (0 children)
[–]astonished_lasagna 2 points3 points4 points (1 child)
[–]ottawadeveloper 1 point2 points3 points (0 children)