Python console/es

Introducción
La Consola de Python es un panel que ejecuta una instancia del intérprete de Python que puede ser utilizado para controlar los procesos de FreeCAD, y crear y modificar objetos y sus propiedades.

La consola de Python en FreeCAD tiene resaltado de sintaxis básico, capaz de diferenciarse con varios estilos y colores, comentarios, cadenas, valores numéricos, funciones incorporadas, salida de texto impreso, y delimitadores como paréntesis y comas. Estas propiedades de la consola pueden ser configuradas en el Editor de Preferencias.



Guión
Introducción a Python, y Tutorial de scripting en Python.

Conceptos básicos de scripting en FreeCAD, y Objetos con scripting.

La consola de Python puede realizar un completamiento de código básico cuando se escribe un punto después de un objeto; mostrará los métodos públicos y atributos (variables) del objeto (clase) actual, por ejemplo,

The console is also able to show the documentation string of a particular function when the opening parenthesis is written, for example,



The FreeCAD initialization scripts automatically load some modules, and define some aliases. Therefore, in the Python console these are available

Therefore these are equal

these pre-loaded modules and aliases are only available from the Python console embedded inside the FreeCAD program. If you use FreeCAD as a library in an external program, you must remember to load the and  modules and define the necessary aliases if you wish.

Acciones
Right click on the Python console shows some commands:
 * : stores the selected text in the clipboard for later pasting; it is disabled if nothing is selected.
 * : stores the selected command in the clipboard for later pasting; it is disabled if nothing is selected.
 * : copy the entire history of Python commands entered in this session.
 * : save the entire history of Python commands entered in this session to a text file.
 * : paste previously copied text in the clipboard to the Python console.
 * : selects all text in the Python console.
 * : erases all commands entered into the Python console. This is useful if the Python console is full of messages and previously entered commands that may be distracting when testing a new function. This is merely aesthetic, as this command doesn't delete existing variables nor clears the imported modules in the session.
 * : opens a dialog to search for a file in the system, then it inserts the full path of the file. This is useful to test functions that process an input file, without having to write the entire name in the console, which is error prone. This command does not run the file, and does not import it as a Python module, it just returns the full path of that file.
 * : wrap very long lines that exceed the horizontal dimension of the Python console.

Notas

 * One has the ability to scroll the API in the Python console. Example:
 * In the console type:
 * A dialog box will display with optional classes/functions to choose from
 * Scroll through the list to read the description of each class/function
 * By choosing a function and following it with a one can repeat steps 2 and 3 to traverse deeper in to the API
 * Tab/Word completion is supported using the + shortcut