无法从Gradle运行python脚本?

时间:2018-08-22 10:28:57

标签: python python-3.x python-2.7 gradle build.gradle

我尝试了以下代码,但不确定是什么问题

task runPython(type:Exec) {
    workingDir 'C:\\Users\\adityaj\\git\\Learn\\TestProject'
    commandLine 'python', 'main.py'
}

Project Hierarchy

还附加了项目层次结构

下面是我的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'
    }
}

0 个答案:

没有答案