简体   繁体   English

PyCharm - 如何创建一个运行/调试配置来执行一个使用 Python 脚本作为参数的 .bat 文件?

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

I want to create a new Run/Debug Configuration which executes a .bat file that accepts a Python script as a parameter.我想创建一个新的运行/调试配置,它执行一个接受 Python 脚本作为参数的.bat文件。

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.我要执行的程序是MonkeyRunner (Android SDK 的一个工具部分),它位于C:\\Users\\talha\\AppData\\Local\\Android\\Sdk\\tools\\bin文件夹中。 And my PyCharm project is located in C:\\Users\\talha\\Documents\\PyCharmProjects folder.我的 PyCharm 项目位于C:\\Users\\talha\\Documents\\PyCharmProjects文件夹中。

而不是在资源管理器中手动导航——只需在此类 bat 文件上使用“导航 | 选择... | 资源管理器 (Alt+F1, 8)”,IDE 将打开资源管理器,该文件已选择https://intellij-support。 jetbrains.com/hc/en-us/community/posts/207057025-Can-I-run-a-batch-file-bat-from-within-the-IDE-

There's a free plugin on the JetBrains marketplace that provides: JetBrains 市场上有一个 免费插件,它提供:

Windows Batch Scripts support for IntelliJ IDEA. Windows 批处理脚本支持 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.当您想通过运行配置执行外部工具时,空运行配置很有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何创建运行python脚本的.bat文件? - How to create .bat file which runs python script? Python 脚本在 Pycharm 中运行,但不是通过 bat 文件 - Python script is running in Pycharm but not via bat file 如何在PyCharm的运行/调试配置中将环境变量作为命令行参数传递? - How to pass an environment variable as a command line parameter in Run/Debug configuration in PyCharm? Pycharm运行/调试使用的Python与配置为解释器的Python不同 - Pycharm Run/Debug uses Python different from one configured as an interpreter Bat文件可在Windows上运行Python脚本 - Bat file to run Python script on Windows 如何使用 Pycharm 调试 python 脚本? - HOW TO use Pycharm to debug python script? 当运行单个脚本文件时,Python 2.7 UnitTest可以很好地运行,但是在Pycharm运行/调试配置中运行文件夹时,它会失败 - Python 2.7 UnitTest works well when run the single script file, but it failed when run the folder in Pycharm Run/Debug Configurations 如何在 Python 中运行使用包的 Julia 文件? - How to run a Julia file, which uses a package, in Python? 如何在pylab中运行一个python文件,该文件会执行另一个python文件? - How do I run a python file in pylab, which executes another python file? PyCharm运行/调试配置弹出窗口静音 - PyCharm run/debug configuration popup silence
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM