Sandbox:Piffpoof3

Python IDE within FreeCAD

Python is a programming environment that is incorporated into the FreeCAD system. Using Python most operations offered by FreeCAD are available for programmatic access. Python programs for FreeCAD are usually developed to be either run on the Python console or through the Macro facility of FreeCAD (see Macro Install HowTo).

There are numerous tools available for program development in Python. The complicating factor for developing Python to use with FreeCAD are twofold: first the tools do not have any support for the numerous data structures and access points of FreeCAD; secondly they do not work "within FreeCAD". This means that you can use them to develop code outside of FreeCAD and not be able to test in the target environment; or you can develop Python in the target environment (i.e. the FreeCAD environment) but not have any support from the development tools. Neither of these is a preferable solution.

Background
Modern software development at the commercial standard is usually done using a set of tools generically referred to as 'IDE'. Typically these tools include the following 3:


 * source code editor
 * build automation tools
 * debugger

which are standard while the following are present in some IDEs but not in others:


 * intelligent code completion
 * integrated compiler, interpreter, or both
 * version control system
 * Graphical User Interface (GUI) construction
 * class browser
 * object browser
 * class hierarchy diagram

A summary of the status of these tools within FreeCAD is ('N/A' meaning 'Not Available'):

Many tools exist to support the above function for Python programming but unfortunately they do not integrate with the FreeCAD development environment.

A list of IDEs for Python is located at Integrated Development Environments for Python

Editors
A list of editors for Python for a variety of platforms is available at Python Editors

Macintosh
For the Macintosh the text editor TextWrangler works well. It has code highlighting and excellent search facilities. There are options to execute jobs in Python but of course they do not work with the FreeCAD environment.

Directories

 * two logicals: freecad macros and userData

Debugger

 * breakpoints


 * using global variables

Coding Framework

 * testStub

Miscellaneous Links
Some other links about IDEs for Python which might be of interest are:
 * Comparison of Python IDEs for Development
 * Choosing the Best Python IDE
 * Your Development Environment
 * PyCharm Community Edition IDE