importing a module from a file without the '.py' suffix

Antoon Pardon antoon.pardon at
Fri Oct 22 07:19:18 EDT 2021

I have a file with python code but the name doesn't end with the '.py' 

What is the easiest way to import this code as a module without changing 
its name?

Antoon Pardon.

More information about the Python-list mailing list