PyCharm - How to create a Run/Debug Configuration that executes a .bat file which uses a Python script as a parameter?

2k Views Asked by At

I want to create a new Run/Debug Configuration which executes a .bat file that accepts a Python script as a parameter.

The program I want to execute is MonkeyRunner (a tool part of Android SDK) which is located in the C:\Users\talha\AppData\Local\Android\Sdk\tools\bin folder. And my PyCharm project is located in C:\Users\talha\Documents\PyCharmProjects folder.

2

There are 2 best solutions below

0
Mathieu Dhondt On BEST ANSWER

There's a free plugin on the JetBrains marketplace that provides:

Windows Batch Scripts support for IntelliJ IDEA. Supports syntax highlighting, run configurations that can run any command, also empty configurations. Empty run configurations are useful when you want to execute an external tool through a run configuration.

0
Nagababu Manikala On

Instead of manually navigating in Explorer -- just use "Navigate | Select in... | Explorer (Alt+F1, 8)" on such bat file and IDE will open Explorer with that file already selected https://intellij-support.jetbrains.com/hc/en-us/community/posts/207057025-Can-I-run-a-batch-file-bat-from-within-the-IDE-