Text fields with Python expression support¶
Various text fields in ecu.test allow the input of complex Python expressions. Besides normal text and numbers, utility functions can be called and variables can be used.
These text fields can be recognized by their background color. The background color also indicates whether the content of the text field is a valid expression.
Green background: Text field with valid expression
Red background: Text field with invalid expression. The content of this text field cannot be saved until it is corrected. Moving the cursor over the text field will display a message showing the reason.
Yellow background: The content of this text field is syntactically correct, but possibly invalid from a semantic point of view (e.g. a variable is not yet defined).
Variables and utility functions can be easily inserted into the text field via context menu or
by using the key combination Ctrl+Space.
Additional information about Python syntax
File path input¶
When putting in paths, they must be valid Python expressions.
Especially paths from Windows platforms contain backslashes \. If a backslash is followed by
letters or numbers, Python interprets them as control characters (e.g. \t for TAB or \n
for a newline). However, not all combinations are control characters, e.g. \c is an invalid
character. The text field will therefore mark the input as invalid.
There are several ways to enter a file path nevertheless:
Manually replacing backslashes
\with forwardslashes/Manually escaping backslashes
\via double backslashes\\Recommended: Use of a raw string by placing an
rin front of the quotation mark (e.g.:r'C:\Users\me')