四、附:python代码
import ostry: env = os.environ["env"]except: env = "env_001" # 默认环境1print('os.environ["env"]', env)if env == "env_001": # 测试设备 10.80.21.50(实验室) 串口为COM5 云台控制COM7 device_ip = "10.80.21.50" serial_com = "COM5" holder_com = "COM7"elif env == "env_002": # 测试设备 10.80.20.161(实验室 pro) 串口为COM12 云台控制(暂无) device_ip = "10.80.20.161" serial_com = "COM12" holder_com = "COM7"elif env == "yqf": # yeqinfang测试环境 device_ip = "10.80.20.104" serial_com = "COM1" holder_com = "COM7"else: raise OSError("环境错误,请检查测试环境!")