Python console/de

Einleitung
Die Python-Konsole ist ein Feld, das eine Instanz des Python Interpreters ausführt, mit dem FreeCAD Prozesse gesteuert, Objekte und deren Eigenschaften erstellt und geändert werden können.

Die Python-Konsole in FreeCAD verfügt über eine grundlegende Syntaxhervorhebung, die es ermöglicht, mit verschiedenen Stilen und Farben, Kommentaren, Zeichenketten, numerischen Werten, eingebauten Funktionen, gedruckter Textausgabe und Trennzeichen wie Klammern und Kommata zu unterscheiden. Diese Eigenschaften der Konsole können im Voreinstellungseditor] konfiguriert werden.



Scripting
Introduction to Python, and Python scripting tutorial.

FreeCAD scripting basics, and Scripted objects.

The Python console can perform basic code completion when a dot is written after an object; it will show public methods and attributes (variables) of the current object (class), for example,

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



The Python console automatically loads some modules, and defines some aliases.

Therefore these are equal

Actions
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.