Hi all,
did anyone know how to run a script from another script in the same way as Pythonista does? I mean, emulate Run button behavior?
First option is - URL scheme - but there's one drawback - This only works if no script is already running when the app is started.
Another option is runpy.run_path. But it looks like that there's some problem with globals, modules, paths, ... When I tried to bind Cmd Shift S ...
def launch_stash():
blackmamba.ide.run_script(os.path.expanduser('~/Documents/launch_stash.py'))
register_key_command(
'S',
UIKeyModifierCommand | UIKeyModifierShift,
launch_stash,
'Launch StaSH...')
... to launch StaSh, it fails with No module named ConfigParser. My run_script looks like:
def run_script(file_path):
runpy.run_path(file_path, run_name='__main__')
What's the recommended way to launch script from a script in the same way as Pythonista does with the Play button?
Thanks,
Zrzka