Just to notify here. (from a newbee, keviv22)
Never and ever for the sake of your own good, name the folders or files with symbols like "-" or "_". If you did so, you may face few issues. like mine, say, though your command for importing is correct, you wont be able to successfully import the desired files which are available inside such named folders.
Invalid Folder namings as follows:
valid Folder namings for above:
What mistake I did:
consider the file structure.
Parent
. __init__.py
. Setup
.. __init__.py
.. Generic-Class-Folder
... __init__.py
... targetClass.py
. Check
.. __init__.py
.. testFile.py
What I wanted to do?
What command I did?
from Core.Generic-Class-Folder.targetClass import functionExecute
SyntaxError: invalid syntax
Tried many searches and viewed many stackoverflow questions and unable to decide what went wrong. I cross checked my files multiple times, i used __init__.py
file, inserted environment path and hugely worried what went wrong......
And after a long long long time, i figured this out while talking with a friend of mine. I am little stupid to use such naming conventions. I should never use space or special symbols to define a name for any folder or file. So, this is what I wanted to convey. Have a good day!
(sorry for the huge post over this... just letting my frustrations go.... :) Thanks!)