I'm really interested in creating a package in python. To do so, I watched and read several tutorials but there is always something that doesn't want to work.
What I'm doing
I created a folder package__tutorial in which I have another folder which corresponds to the name of my package - mypackage.
Folder mypackage contains two files:
__init__.py- file which indicates where the package isfunctions.py- file which contains functions to be included into the package
In functions.py have some one basic function:
def average(x,y):
return (x+y)/2
To summarize - my file structure is the following
package__tutorial containing mypackage containing __init__.py and functions.py.
I tried to load my package using import mypackage and then use average(2,8) but I get message that name 'average' is not defined. It seems that my computer doesn't see my newly created package. Have I done something wrong/something is missing ?