Skip to content Skip to sidebar Skip to footer

How To Run A File From Another Python File

a.py from kivy.app import App from kivy.uix.dropdown import DropDown from kivy.lang import Builder class CustDrop(DropDown): def __init__(self, **kwargs): super(CustD

Solution 1:

The solution is as follow:

Snippet

a.py

...

kv_str = Builder.load_string('''
#:import os os
...
        CustDrop:

            id: dropdown

            Button:
                text: 'Run another script'
                size_hint_y: None
                height: '48dp'
                on_release: os.system("python3 b.py")

Output

enter image description here enter image description here


Solution 2:


Post a Comment for "How To Run A File From Another Python File"