I need a simpler way to load my script since it is used by other people and at the same time different operating system that are between linux and windows at the moment I use execfile () but you have to change the format of The addresses also try sys.path.insert (0, PATH) but you do not have access to the resources you import into the main file file
ruta = "/home/lacosta/Documents/"
capa0 = "LIBRERIAS/TOOL/"
capa1 = "LIBRERIAS/BAIL/"
capa2 = capa1
# cargando funciones
# capa 0
execfile(ruta + capa0 + "Loadmain.py")
execfile(ruta + capa0 + "funcion_tool.py")
execfile(ruta + capa0 + "funcion_mathGeo.py")
with the sys.path.insert (0, PATH) I only have to give the address of the folder but the functions do not recognize that other modules such as the math and vector are imported. before loadmain and mark error that has not been defined
FREECADPATH = '/home/lacosta/Documents/LIBRERIAS/'
sys.path.insert(0, FREECADPATH)
import math
from Part import *
from FreeCAD import Vector, Rotation, Placement
import Draft
from TOOL.Loadmain import *