I am new to FreeCAD and New to Python. I have FreeCAD installed on Windows 7.
I wanted to have a location to store my .py files, but cannot find an easy way to do this with a path setting in Preferences.
Where is the normal place to store users .py files and how do you tell FreeCAD where they are?
Users Python script locations on Windows
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 15
- Joined: Tue May 06, 2014 3:58 pm
Re: Users Python script locations on Windows
The macro folder is in the python path. Setting the macro path in the preferences and putting the .py files should work.
It is also possible to call a python script from somewhere else in the python console with
Ulrich
It is also possible to call a python script from somewhere else in the python console with
Code: Select all
execfile("your_path_to_python_script")
-
- Posts: 15
- Joined: Tue May 06, 2014 3:58 pm
Re: Users Python script locations on Windows
Thanks for quick reply Ulrich1a,
The execfile command tip was useful.
For the my python file locations on my Windows 7 machine I changed the target shortcut path from
"C:\Program Files (x86)\FreeCAD0.13\bin\FreeCAD.exe"
to
"C:\Program Files (x86)\FreeCAD0.13\bin\FreeCAD.exe" --python-path C:\Users\swhite\Documents\MyPython
If I extended the macro path to
C:\Users\swhite\AppData\Roaming\FreeCAD\;C:\Users\swhite\Documents\MyPython
then saving macros became confused.
I really wanted to keep my macros at C:\Users\swhite\AppData\Roaming\FreeCAD\ separate from my .py files.
Steve
The execfile command tip was useful.
For the my python file locations on my Windows 7 machine I changed the target shortcut path from
"C:\Program Files (x86)\FreeCAD0.13\bin\FreeCAD.exe"
to
"C:\Program Files (x86)\FreeCAD0.13\bin\FreeCAD.exe" --python-path C:\Users\swhite\Documents\MyPython
If I extended the macro path to
C:\Users\swhite\AppData\Roaming\FreeCAD\;C:\Users\swhite\Documents\MyPython
then saving macros became confused.
I really wanted to keep my macros at C:\Users\swhite\AppData\Roaming\FreeCAD\ separate from my .py files.
Steve