我尝试过以下代码,但不确定问题是什么
task runPython(type:Exec) {
workingDir 'C:\\Users\\adityaj\\git\\Learn\\TestProject'
commandLine 'python', 'main.py'
}
Run Code Online (Sandbox Code Playgroud)
还附上项目层次结构
下面是我的 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'
}
}
Run Code Online (Sandbox Code Playgroud) 我想在远程系统上执行命令,并希望获得相同的结果.
我试过以下代码:
package rough;
import java.io.InputStream;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.Session;
public class RemoteSSH {
public static void main(String[] args) {
String host = "\\\\10.209.110.114";
String user = "Administrator";
String password = "Admin123";
String command1 = "ipconfig";
try {
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
JSch jsch = new JSch();
Session session = jsch.getSession(user, host, 22);
session.setPassword(password);
session.setConfig(config);
session.connect();
System.out.println("Connected");
Channel channel = session.openChannel("exec");
((ChannelExec) channel).setCommand(command1);
channel.setInputStream(null);
((ChannelExec) channel).setErrStream(System.err);
InputStream in = channel.getInputStream();
channel.connect();
byte[] tmp …Run Code Online (Sandbox Code Playgroud) 例如,以下代码用于单个选择值
choice{
choices: 'Box\nOneDrive\nSharePointOnline\nGmail\nGDrive\nGenericS3',
defaultValue: 'box',
description: 'Connector to build',
name: 'On_Cloud_Devices_To_Test'
}
Run Code Online (Sandbox Code Playgroud)