我正在寻找一种解决方案来跟踪花在软件上的时间。
想到触发python脚本并间接使用其路径调用exe。
但是可以在打开exe文件时触发python脚本吗?
说,我正在打开drRacket.exe,
在每个会话中,我的python脚本更新会话所花费的时间 必须被触发。
另外,我也需要跟踪退出时间......
答案 0 :(得分:1)
如果您知道如何从终端调用.exe,请使用os
- 模块调用它并使用简单的时间戳来比较开始和结束时间:
import os, time
start=time.time()
os.system("<command to start your script>")
print("spent time:",time.time()-start)