'Import with dot name in python

How can I import a dotted name file in python?

I don't mean a relative path, but a filename starting or containing a dot "."

For example: '.test.py' is the filename.

import .test will search for a test package with a py module in a parent package.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source