2018-02-04, 13:23
So as you may know or soon to figure out I am self taught anything to do with python as many of you are. Going on that I have a working add-on in python 2 upon testing in python 3 it fails miserably.
This brings up basic question that I cant seem to find by just googling as before, it may be I am not asking them correctly, so I come here for help if you may.
biggest issue I read that when importing a sub directory it has to be a absolute path that py3 no longer support relative paths...
So where I have
before I could import a .py from my lib with
once done I could import other items the lib folder by simply calling them. Now with py3 I have to lib. in front of every import. And that is fine but my issues comes in when I try to import the sqlpackage
before I could simply
and I am assuming it imported the complete code as it worked as expected. where as now I am not sure how I should import the package as a whole.
This brings up basic question that I cant seem to find by just googling as before, it may be I am not asking them correctly, so I come here for help if you may.
biggest issue I read that when importing a sub directory it has to be a absolute path that py3 no longer support relative paths...
So where I have
xml:
My add-on/
My add-on/lib
my add-on/lib/mysqlpackage
my add-on/lib/mysqlpackage/its scripts and subfolders
before I could import a .py from my lib with
python:import lib.database
once done I could import other items the lib folder by simply calling them. Now with py3 I have to lib. in front of every import. And that is fine but my issues comes in when I try to import the sqlpackage
before I could simply
from the database.pypython:import mysqlpackage
and I am assuming it imported the complete code as it worked as expected. where as now I am not sure how I should import the package as a whole.