Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.56 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.56 KB

Java Embedded Python (JEP) SwingConsole

A Java Swing interactive console for Java Embedded Python (JEP) with readline-esque support

Java Embedded Python (JEP) SwingConsole - Hello, World!

Try it out by executing the following:

mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.2:copy \
  -Dartifact=com.creemama.swingconsole:swingconsole-jep:3.9.0.0.0.1:jar:jar-with-dependencies \
  -DoutputDirectory=. \
&& java -Djava.library.path=/path/to/jep.dll.jnilib.so/dir -jar swingconsole-jep-3.9.0.0.0.1-jar-with-dependencies.jar

Use the following code snippet as a guide to embed a JEP SwingConsole into your application:

public static void main(String[] args) throws JepException {
	ConsoleConfig config = new ConsoleConfig()
			.evalFile("/path/to/startup/script.py")
			.put("java_variable", new StringBuilder("Console-Accessible Variable"))
			.banner("JEP {{VERSION}} Python {{PYTHON_VERSION}} Java " + System.getProperty("java.version") + "\n")
			.historyFile(new File(System.getProperty("user.home"), ".jep"));
	SwingConsoleFrame console = new SwingConsoleFrame("Java Embedded Python (JEP) Console");
	console.run(new JepSwingConsole(config));
}

To add JEP SwingConsole as a dependency in your Maven project, use the following:

<dependency>
  <groupId>com.creemama.swingconsole</groupId>
  <artifactId>swingconsole-jep</artifactId>
  <version>3.9.0.0.0.1</version>
</dependency>