On Fri, Oct 22, 2021 at 10:36 PM Antoon Pardon <antoon.par...@vub.be> wrote:
>
> I have a file with python code but the name doesn't end with the '.py'
> suffix.
>
> What is the easiest way to import this code as a module without changing
> its name?
>

It should be possible to use importlib for this:

https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to