Linux 环境下 代码 java 调用 python 出错

@[TOC]
摘要
情况 1:IOException: Cannot run program "python /temporary2/plus_non_main.py": error=2, No such file or directory
情况 2:SyntaxError: Non-ASCII character '\xe6' in file /temporary2/plus_include_main.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
情况 1:IOException: Cannot run program "python /temporary2/plus_non_main.py": error=2, No such file or directory
原因:python 不认识

解决方法:将 python 的执行改为绝对路径,也就是找到 python.exe 的所在位置
情况 2:SyntaxError: Non-ASCII character '\xe6' in file /temporary2/plus_include_main.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
原因:py 脚本定义的 def 函数中使用’’’注释快’’进行注释’’’
复制代码
解决方案:def 定义的函数中使用“#单行注释”
评论