커밋
						5cdccdc4cf
					
				4개의 변경된 파일과 63개의 추가작업 그리고 0개의 파일을 삭제
			
			
		@ -0,0 +1,29 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8"?> | 
				
			|||
<project xmlns="http://maven.apache.org/POM/4.0.0" | 
				
			|||
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 
				
			|||
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 
				
			|||
    <modelVersion>4.0.0</modelVersion> | 
				
			|||
 | 
				
			|||
    <groupId>org.example</groupId> | 
				
			|||
    <artifactId>java4python</artifactId> | 
				
			|||
    <version>1.0-SNAPSHOT</version> | 
				
			|||
    <dependencies> | 
				
			|||
        <dependency> | 
				
			|||
            <groupId>org.python</groupId> | 
				
			|||
            <artifactId>jython-standalone</artifactId> | 
				
			|||
            <version>2.7.0</version> | 
				
			|||
        </dependency> | 
				
			|||
    </dependencies> | 
				
			|||
    <repositories> | 
				
			|||
        <repository> | 
				
			|||
            <id>spring</id> | 
				
			|||
            <url>https://maven.aliyun.com/repository/public</url> | 
				
			|||
            <releases> | 
				
			|||
                <enabled>true</enabled> | 
				
			|||
            </releases> | 
				
			|||
            <snapshots> | 
				
			|||
                <enabled>true</enabled> | 
				
			|||
            </snapshots> | 
				
			|||
        </repository> | 
				
			|||
    </repositories> | 
				
			|||
</project> | 
				
			|||
@ -0,0 +1,16 @@ | 
				
			|||
import org.python.util.PythonInterpreter; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @author yanpeng | 
				
			|||
 * @version 1.0 | 
				
			|||
 * @desc TODO | 
				
			|||
 * @company 北京中经网软件有限公司 | 
				
			|||
 * @date 2021/7/16 17:43 | 
				
			|||
 */ | 
				
			|||
public class JavaRunPythonCode { | 
				
			|||
    public static void main(String[] args) { | 
				
			|||
        PythonInterpreter interpreter = new PythonInterpreter(); | 
				
			|||
        interpreter.exec("a='hello world'; "); | 
				
			|||
        interpreter.exec("print a;"); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,15 @@ | 
				
			|||
import org.python.util.PythonInterpreter; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @author yanpeng | 
				
			|||
 * @version 1.0 | 
				
			|||
 * @desc TODO | 
				
			|||
 * @company 北京中经网软件有限公司 | 
				
			|||
 * @date 2021/7/16 17:43 | 
				
			|||
 */ | 
				
			|||
public class JavaRunPythonFile { | 
				
			|||
    public static void main(String[] args) { | 
				
			|||
        PythonInterpreter interpreter = new PythonInterpreter(); | 
				
			|||
        interpreter.execfile("classpath:/javaPythonFile.py"); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,3 @@ | 
				
			|||
a = 1 | 
				
			|||
b = 2 | 
				
			|||
print (a + b) | 
				
			|||
					불러오는 중...
					
					
				
		Reference in new issue