...
Page Content
Table of Contents | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
This page describes how to use Python script.
...
The script editor has a rich set of functionalities that let you edit your script easily. Here
is a brief description of the available features:
Syntax highlighting | Provide different colors and text styles to be given to dozens of different lexical sub-elements of the Python syntax. These include keywords, comments, control-flow statements, variables, and other elements. Programmers often heavily customize their settings in an attempt to show as much useful information as possible without making the code difficult to read. |
---|---|
Code analysis | Provides error finding in python programs. It finds common errors such as undefined tokens, duplicated signatures and warns about things such as unused variables or unused imports. |
Code completion | provides context-sensitive completions and is enabled with Ctrl+Space key in the editor. |
Refactoring | Provides functionalities to change the source code to improve code readability, reduce complexity and improve the maintainability of the source code such as renaming, extracting, inlining code elements. |
Navigation Views | Outline View, Hierarchy View, ... |
Content Assistants | Helps user to write code faster and more efficiently by providing list of accessible keywords such as variable, method, import, module, ... |
Once your script is open in the editor, perform the following steps to edit your script:
...
This perspective has the actions needed for debugging and allows you to see the variables and evaluate expressions.
...
Stack view | You can see the variables in previous stacks by clicking on the stack to view. |
---|---|
Variables view | Allows you to see the globals and locals for the selected stack. |
Breakpoints view | Allows you to see the breakpoints available and enable/disable any breakpoint. |
Editor | Shows the code and highlights the line to be executed. |
Console | Shows the output of the Python script. |
The basic things you can do in the debugger have some key bindings:
Step in | F5 |
---|---|
Step over | F6 |
Step out | F7 |
Resume | F8 |
Migrating scripts from Python 2 to Python 3
...
Please note that the following caveats have been observed with the 2to3 tool:
...
not all the changes suggested by the 2to3 tool are essential for the scripts to be operational in Python 3.9. Some of the changes proposed are more of a recommended programming, but the old Python 2 syntax remains valid. The user remains responsible for using his their own judgement.
scripts containing non-standard English characters (such é,ö, etc.) will make the 2to3 tool fail, even if they are only part of comments. This is not unique to 2to3 and can be fixed by specifying the encoding of the python scripts. The relevant documentation can be found here: Shebang lines - Encoding declarations
more generally, information about porting Python 2 code to Python 3 can be found in the python documentation