lib.py add platform detect.