How could I accomplish extending the function code WITHOUT entering the file and manually typing it out?, a bit like how you can add routes from other files using flask-blueprints.
I’ll refer you to the fundamental theorem of software engineering:
If you’re dead set on not solving this by literally opening that file and adding that line, then you can solve the problem by, instead of directly calling hello, call it ‘indirectly’ through a different function:
# suppose `that_file.py` contains the `hello` defined in the question
import that_file
def indirect_hello():
that_file.hello()
# you can add stuff
print("everyone")
# no longer call `hello` directly
#that_file.hello()
indirect_hello()
But do think about the costs in terms of complexity and the maintenance costs of updating all references to the original hello. But hey, updating all the references is something you only have to do once; then after that, you can make changes to indirect_hello almost for free.