该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
package com.hmammon.service;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import org.python.core.PyFunction;
import org.python.util.PythonInterpreter;
public class Test {
public static void main(String[] args) {
PythonInterpreter interpreter = new PythonInterpreter();
InputStream filepy = null;
try {
filepy = new FileInputStream("C:\\Users\\xcfh002\\Desktop\\12306\\train_Standard.py");
interpreter.execfile(filepy);
} catch (FileNotFoundException e) {
e.printStackTrace();
}finally{
try {
filepy.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
=============================================================================
报错:Exception in thread "main" Traceback (innermost last):
(no code object) at line 0
SyntaxError: ('invalid syntax', ('', 26, 41, " allStationsStr = collects[0][1] if collects and len(collects) > 0 else ''"))