Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个build.gradle文件。我需要添加一个代码来执行我编写的 python 脚本。谁能告诉我该怎么做?build.gradle是用 groovy 编写的。所以,如果你觉得我的问题还不够,请多问。
build.gradle
看一下Exec任务。它可用于运行命令行进程。
您可以创建如下任务:
task runPython(type:Exec) { workingDir 'path_to_script' commandLine 'python', 'my_script.py' }