You can get system boot time using below script,
import os; btime=os.popen(‘systeminfo | find /i “Boot Time”’).read(); print(btime);
Sample output would be,