file_a.py
while 1:
print 1
When I remove, rename, even change "print 1" to "print 2", it is still running with printing 1.
Does it mean python runs with pyc files? What kind of feature of interpreter works here?
while 1:
print 1
When I remove, rename, even change "print 1" to "print 2", it is still running with printing 1.
Does it mean python runs with pyc files? What kind of feature of interpreter works here?
You seem to misunderstand the execution process. With most conventional Python implementations, it essentially goes like this: your source file is compiled into bytecode, and that bytecode is run in a VM. Changing the source file after the fact has no bearing on code that is already running.
What you describe is a feature of some languages, however (e.g. Erlang). It's called hot swapping.