Sublime Forum

How to always print the file name in the result display panel as default when executing a file?

#1

In Spyder, it is a default that whenever you execute a .py file, it will print the file directory and file name such as runfile('E:/my_dir/my_py,py', wdir='E:/my_dir').

Is there a way to do the same thing with Sublime text?

0 Likes

#2

Sublime uses sublime-build files to run external programs of any sort in response to building and running software (for example when running Python programs), and generally it only shows you what it tried to execute if running the program failed (as diagnostic output).

One way to do something like that would be to modify the build system so that it executes a batch file or shell script that displays what you want before it executes. Alternatively with some plugin work you can customize how Sublime executes your sublime-build file, though that’s a more advanced topic.

0 Likes