You are reading the documentation for version 1.6 of OpenStructure. You may also want to read the documentation for: 1.1 1.2 1.3 1.4 1.5 devel

The Python Shell

class PythonShell

OpenStructure has a powerful Python Shell which has some handy features. It is completely integrated into OpenStructure and allows you enter Python code.

Multi line detection

The Python Shell detects automatically if a code block is complete or not. For example a simple print statement in the command line is a complete code block. Therefore the code will be executed after pressing enter:

../../_images/100210_single_line.png

When a multiline codeblock (like a for loop or an if instruction) is being entered in the command line, the code is not executed until the code block is complete:

../../_images/100210_multi_line.png

When a code block is not complete, pressing enter appends an empty line at the end of the code block. To execute such a code block, you simply have to press enter twice.

Auto completion

After pressing tab in the Python Shell, it returns you possible extensions to your entered text. This feature can be used for completing variable names or functions:

../../_images/100210_auto_completion.png

It is also possible to complete a file system path string. By pressing tab while editing a string, the shell displays all file or folders of the given directory:

../../_images/100210_path_completion.png

Contents

Search

Enter search terms or a module, class or function name.

Previous topic

Tools

Next topic

The Sequence Viewer

You are here