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/environment_6_0.png
%%there kv
<MyButton@Button>:
    text: "Orange?"
        
MyButton:
    font_size: 100

color: "orange" rule is removed:

%there screenshot -w 200
../_images/environment_9_0.png