0

I have to import another .py file with the name "00 xyz.py" how do I import the file as simply importing it the conventional way wouldn't work.

import 00 xyz.py as xyz
user13412850
  • 509
  • 1
  • 5
  • 16
  • Does this answer your question? [How to import a module in Python with importlib.import\_module](https://stackoverflow.com/questions/10675054/how-to-import-a-module-in-python-with-importlib-import-module) – python_user Apr 12 '21 at 08:13
  • thanks @python_user, unfortunately I come from non tech background so still didn't get answer to my Q from that link. – user13412850 Apr 12 '21 at 09:31
  • 1
    `import importlib` `xyz = importlib.import_module('00 xyz')` this should work, make sure you type them in two lines – python_user Apr 12 '21 at 12:10
  • 1
    perfect! thanks @python_user that was most helpful! – user13412850 Apr 12 '21 at 12:36

0 Answers0