Run button in Python editor: does it work only for main.py?
It seems that the
run button in the code editor of Python REPLs works only for the
main.py file, not for other source files. Do I understand correctly?
I'm asking because when I click
run in files other than
main.py nothing seems to happen in the Python shell, no code is apparently evaluated.
Yes, main.py is the default file that is run and there's not really a practical way to change this at the moment. You can however, run other py files by doing
import otherfile at the top of main.py.
Please upvote my comment if it was helpful or useful. Thank you!