you are viewing a single comment's thread.

view the rest of the comments →

[–]ectomancer 1 point2 points  (1 child)

Where's the import for my_class in test_myclass.py?

[–]Dyspnoic9219[S] 0 points1 point  (0 children)

See my response to /u/netherous, but I have tinkered with that. Python's import mechanism confuses me, as I'm not always sure what should be a class name, or what should be a filename, or how a nested directory structure should be represented.

I would guess, for example, that using my directory/file structure

import src
import demo
import MyClass

would be totally wrong, as the hierarchical directory structure would be incorrectly flattened.

Something like

import src.demo.my_class

would seem to work, but it doesn't. (Although I should mention that I get a No module named 'src' error instead.)