Import from different directories in python?

The following is from docs.python.org/tutorial/modules.html#in... Note that both explicit and implicit relative imports are based on the name of the current module. Since the name of the main module is always "__main__", modules intended for use as the main module of a Python application should always use absolute imports. You're running your module ModuleToCheck_test.

Py as the main module, hence the exception. One solution is to create a test. Py module in your src directory containing the following: import Test.

ModuleToCheck_test You can then run that module using python test.py.

Ah, k. That wasn't clear to me. I'll try it – philipp Jan 28 at 11:21 +1, that is the only sane way in python to have entry point at top location, that way everything under src will be in pythonpath – Anurag Uniyal Jan 28 at 11:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions