Sublime Forum

Python console functionality

#1

Hi,

Is there any way to save from the Python console?
Is it possible to execute Windows command-line operations from the Python console?
Is it possible to map a hotkey to a Python script which is executed in the command line?

Thanks,

0 Likes

#2
view.run_command("save")

You can use the standard python APIs for executing system commands (sorry my python isn’t up to tell you what they are called, possibly something like os.system. Don’t forget to import os first.)

Not directly - hotkeys have to run commands, but you can define a custom command in the plugin that runs the script you want

0 Likes