路径

print(__file__)
print(os.path.realpath(__file__))
print(os.path.dirname(os.path.realpath(__file__)))#########################
C:/Users/xxx/PycharmProjects/learn/a.py
C:\Users\xxx\PycharmProjects\learn\a.py
C:\Users\xxx\PycharmProjects\learn

DEFAULT_ADB_PATH = {
"Windows": os.path.join(STATICPATH, "adb", "windows", "adb.exe"),
"Darwin": os.path.join(STATICPATH, "adb", "mac", "adb"),
"Linux": os.path.join(STATICPATH, "adb", "linux", "adb"),
"Linux-x86_64": os.path.join(STATICPATH, "adb", "linux", "adb"),
"Linux-armv7l": os.path.join(STATICPATH, "adb", "linux_arm", "adb"),
}
#DEFAULT_ADB_PATH dict,

system = platform.system()  # Windows
machine = platform.machine() # x86_64
adb_path = DEFAULT_ADB_PATH.get('{}-{}'.format(system, machine)) # None 和 有值
DEFAULT_ADB_PATH.get(system)
 

 

posted @ 2020-03-09 09:22  我要成为女技术宅  阅读(136)  评论(0编辑  收藏  举报