Execution environment

Contents

Execution environment#

%load_ext pythonhere
%connect-there

Commands are executed in the application main thread, thread is blocked until the end of a cell code execution.
On first SSH connection, BoxLayout is set as a root widget.

Variables in the scope of the %there command:

  • app - Kivy application instance

  • root - current root widget

%%there
print(app)
print(root)
<__main__.PythonHereApp object at 0x9ceddfb0>
<kivy.uix.boxlayout.BoxLayout object at 0x9beec9c8>

KV rules#

%there kv rules processing is different from the normal Kivy behavior.
When class is registered for second time with the same name, previous declaration for that class is deleted.

%%there kv
<MyButton@Button>:
    color: "orange"
    text: "Orange"
        
MyButton:
    font_size: 100
%there screenshot -w 200
../_images/f902bd745a6586ebe137661616b5a056f844441d7fae02bb62429eef7dc73b41.png
%%there kv
<MyButton@Button>:
    text: "Orange?"
        
MyButton:
    font_size: 100

color: "orange" rule is removed:

%there screenshot -w 200
../_images/83d421b1a84ea419d4e674dd5bebc136ff4c3cf77ef9df7442c584a6cde3a0ed.png