New ScreenPanel

This commit is contained in:
2018-01-19 10:56:53 +01:00
commit ae4d621609
580 changed files with 46598 additions and 0 deletions

39
plugins/PythonInteractive.java Executable file
View File

@@ -0,0 +1,39 @@
import java.io.PrintStream;
/**
*
*/
public class PythonInteractive {
public static void main(String[] args) throws Exception {
ProcessBuilder builder = new ProcessBuilder("python", "-i");
builder.redirectErrorStream(true);
Process p = builder.start();
PrintStream printStream = new PrintStream(p.getOutputStream(), true);
new Thread(() -> {
int r;
try {
while (p.isAlive()) {
while (p.getInputStream().available() > 0) {
r = p.getInputStream().read();
System.out.print(Character.toString((char) r));
}
Thread.sleep(10);
}
} catch (Exception ex) {
System.err.println(ex);
}
}).start();
Thread.sleep(200);
String cmd = "print (1+2)";
System.out.println(cmd);
printStream.println(cmd);
Thread.sleep(200);
p.destroy();
}
}