def settingtime():
while True:
starttime = time.strftime("%H:%M:%S");
recordcmd=“adb shell screenrecord /sdcard/demo.mp4”
pullfile=“adb pull /sdcard/demo.mp4 /Users/shixinfa/Desktop/0402”
AVATAR_STRANGER_PATH = “/Users/shixinfa/Desktop/0402”
os.system(recordcmd)
os.system(pullfile)
image = os.path.join(AVATAR_STRANGER_PATH, “demo.mp4”)
# 分离文件名和目录
dirname, filename = os.path.split(image)
# 改名
new_file = os.path.join(dirname, starttime+".mov")
print(“image=” + image, “dirname=” + dirname, “filename=” + filename,“new_file=”+new_file)
os.rename(image, new_file)
settingtime()
python android 录制屏幕
最新推荐文章于 2023-07-03 14:19:55 发布