I am trying to setup PyCharm to invoke a shell script, instead of python, as the run option. Is this possible? In the default options I only have Python, Python docs, and Python tests. With the professional edition I also have Django and others. However, they all have python as the interpreter in a combobox and they can't be changed as far as I can see.
相关问题
- XDG_RUNTIME_DIR points to non-existing path
- wxPython and PyCharm on Mac
- PyCharm referencing older, removed variable
- Pycharm Error - 'pip' is not an internal o
- Correct usage of typing types for args and kwargs?
相关文章
- pycharm上传代码到github,为什么不能指定某一个项目,而是默认上传第一个项目
- Profiling Django with PyCharm
- How to fix this strange error: “RuntimeError: CUDA
- Pycharm Edu 无法运行代码
- PygraphViz Import Error With PyCharm
- How do you edit the default `__author__ = name` li
- using stdin in pycharm [duplicate]
- Process finished with exit code -1073741819 (0xC00
Another hacky solution to this is altering the
config/options/jdk.table.xml
file in your PyCharm's configuration folder. You simple add another entry in yourjdks
list:After that just select your interpreter for your project and you can use this shell as your interpreter. I used this solution when using interpreter inside docker's image.
I think the easiest way is to just write a python script that calls the .bat file, and then run that:
This is really a missing feature that normally should be considered as basic functionality. There are two options
First i tried to create a standard (empty) Python configuration and used the "Before launch"->External tool option, therefore you must create a new external tool definition with Tool Settings:
The annoying thing about this solution is, that the "external tool" standard output is redirected to an extra tab in the console log window which is immediately going into the background when the dummy Python Configuration is executed afterwards.
If you want to see such a feature in PyCharm please vote on IDEA-112256 'Command Line' Run Configuration feature request.
Run/Debug Configurations section of Pycharm's online help lists all supported types of Run/Debug configurations and there's no support for shell scripts indeed. However, you might be able to add such support by installing a plugin. For example, if you are interested in bash scripts there's BashSupport plugin which adds support for running shell scripts in Run/Debug configuration.
From plugins' home page:
For Windows there's CmdSupport plugin which provides an action to run .cmd scripts. It seems it does not support running such scripts as Run/Debug configuration however.
As a workaround you can use Python run/debug configuration, specifying some dummy (empty) Python file to run and use Before launch option specifying External tool and specify path to the script when adding/configuring this external tool. See In IntelliJ IDEA, how can I create a key binding that executes a shell script with the current file as a parameter? for details.
As PyCharm is based on IntelliJ's IDEA platform the question IntelliJ IDEA: Running a shell script as a Run/Debug Configuration is very related.
Speaking of run/debug configurations you might be interested in the plugin Run Configuration as Action which