
Hello,
On Wed, 5 Aug 2015 02:14:55 -0600 Eric Snow ericsnowcurrently@gmail.com wrote:
On Aug 4, 2015 11:46 PM, "Cameron Simpson" cs@zip.com.au wrote:
On 04Aug2015 23:01, Eric Snow ericsnowcurrently@gmail.com wrote:
Be sure to read through PEP 495.
Sorry, I meant 395.
I'm sorry for possibly hijacking this thread, but it touches very much issue I had on my mind for a while: being able to run modules inside package as normal scripts. As this thread already has few people knowledgeable of peculiarities of package imports, perhaps they can suggest something.
Scenario:
There's a directory ("pkg" (representing Python namespace package)), and inside it, there's bar.py of not relevant content and foo.py with "from . import bar". What I'd like to do is (while inside "pkg" directory):
python3 foo.py
Current behavior:
SystemError: Parent module '' not loaded, cannot perform relative import
Expected behavior:
"from . import bar" in foo.py is successful.
-eric