It is possible to remove part of the script from another script

It is possible to remove part of the script (like class and every line that is inside that class) from another script?
I know that you can add to a file from another script, but I’m interested if removing specific module(class) that can be in the middle of the script, is possible?

Thank you.

it’s technically possible… not sure why you would want to do it though. At runtime, the ‘lines of code’ no longer exist, but you could use normal file IO methods to parse and edit the script, then use importlib to reload it.