I would like to be able to use my own modules in FreeCAD scripts. I also have places where I prefer to keep these, and I add these locations to my PYTHONPATH environment variable.
Code: Select all
$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
>>> print (user _paths)
File "<stdin>", line 1
print (user _paths)
^
SyntaxError: invalid syntax
>>> print (user_paths)
['', '/home/*****/src/python', '/home/*****/src/******/mechanical/freecad-python-modules']
>>>
Code: Select all
>>> import os
>>> user_paths = os.environ['PYTHONPATH'].split(os.pathsep)
>>> print (user_paths)
['']