I am in the habit of using raw_input(...) for certain debugging. However, in python3 this has changed to input(...). Is there a way to define an alias at the top of my project, such as:
# __init__.py
raw_input = input
I tried the above, but it only worked in the file I added it to, and not any other files in that directory. I'd like this to work basically in every file within my python repository.
raw_input = input?inputmethod is already the equivalent of Python 2'sraw_input. It's Python 2'sinputthat doesn't exist anymore.PYTHONSTARTUP, but that only works for interactive interpreter sessions. See also: How to add builtin functions (tldr: not really possible)