我想要让下面代码中的,某几行打开程序后只运行一次如下,下次打开程序也是只运行一次
def pointDetect(self):
# 设置无线连接
os.system("adb tcpip 5555")
time.sleep(10)
os.system("adb connect 192.168.1.1")
os.system("adb push C:/Users/Administrator/Desktop/1.txt /sdcard/")
os.system("adb shell input keyevent 26")
os.system("adb shell input swipe 540 1300 540 500 100")
print("导入成功")
打开程序 只运行一次的代码
os.system("adb tcpip 5555")
time.sleep(10)
os.system("adb connect 192.168.1.1")