boot.py
import os
if(os.path.exists("/boot/efi")):
print "System is booted with UEFI"
else:
print "System is booted with lagecy boot"
import os
if(os.path.exists("/boot/efi")):
print "System is booted with UEFI"
else:
print "System is booted with lagecy boot"