How to run one python file in another file? [duplicate]
问题 This question already has answers here : How can I make one python file run another? [duplicate] (8 answers) Closed 20 days ago . import importlib importlib.import_module('file.py') error: ModuleNotFoundError: No module named 'file.py'; 'file' is not a package Is this a good way of running one file in another? If not, could you please tell me a better way? Thank you in advance! 回答1: If you want to import it as a module you should listen to the comments and do what they say (visit How to