更新时间:2023-01-23 09:10:59
***的答案是不要.将您的 getCameras.py 编写为
The best answer is don't. Write your getCameras.py as
import stuff1
import stuff2
import sys
def main(arg1, arg2):
# do whatever and return 0 for success and an
# integer x, 1 <= x <= 256 for failure
if __name__=='__main__':
sys.exit(main(sys.argv[1], sys.argv[2]))
从你的其他脚本,你可以做
From your other script, you can then do
import getCamera
getCamera.main(arg1, arg2)
或调用 getCamera.py 中的任何其他函数
or call any other functions in getCamera.py