python - 无法从 Gradle 运行 python 脚本?
问题描述
我尝试了以下代码,但不确定是什么问题
task runPython(type:Exec) {
workingDir 'C:\\Users\\adityaj\\git\\Learn\\TestProject'
commandLine 'python', 'main.py'
}
还附加了项目层次结构
下面是我的 build.gradle 文件:
plugins {
id 'groovy'
id 'com.gradle.plugin-publish' version '0.9.10'
id 'eclipse'
}
apply plugin: 'eclipse'
//apply plugin: 'py-build'
repositories {
jcenter()
}
dependencies {
testCompile 'pypi:Werkzeug:0.7'
testCompile 'pypi:Jinja2:2.4'
testCompile 'pypi:itsdangerous:0.21'
testCompile 'pypi:click:2.0'
}
task runPython(type:Exec) {
workingDir 'C:\\Users\\adityaj\\git\\Learn\\TestProject'
commandLine 'python', 'main.py'
}
test {
testLogging {
events 'skipped', 'failed', 'standard_error'
exceptionFormat 'full'
}
}
解决方案
推荐阅读
- spatial - 空间查询 dsl - GeometryExpressions。查找范围包含给定“点”的实体
- spring - 使用 Heroku CLI 部署 Spring Boot 时出错
- javascript - 如何使用Aync在nodejs中顺序处理同一类实例的方法
- php - Laravel Eloquent 从一个表中选择并在另一个表中有匹配项时加入第一行
- javascript - JavaScript - 计算数组中每个索引的百分比
- python-3.x - 如何设置云运行应用程序以在 python 中接收发布/订阅消息?
- python - For循环只迭代到一半?
- javascript - 如何在函数式编程中注入属性?
- python - 自定义布局管理器中缺少子小部件的调整大小事件
- android - Nativescript / Android:avdmanager 显示设备,但 nativescript 找不到它们