根据文章 https://stackoverflow.com/questions/6086047/get-output-of-python-script-from-within-python-script
我创建了 在线网页 (.html) 运行其他 .py 脚本,也就是 import 自己的脚本,结果遇 model not found error
逻辑上似乎 python 代码没问题,可能是设置错误或其他我自己没有想到的问题
- printbob.py
import sys
def main(args):
for arg in args:
print(arg)
if __name__ == '__main__':
main(sys.argv)
- test_0109_003.html
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body>
<b><p>title test 1.10-test_get_ print </p></b>
<br>
<py-script>
import printbob
printbob.main('arg1 arg2 arg3 arg4'.split(' '))
</py-script>
</body>
</html>
那么该如何解决这个问题