How can I get the path to the %APPDATA% directory in Python?

后端 未结 3 694
悲&欢浪女
悲&欢浪女 2020-12-13 16:57

How can I get the path to the %APPDATA% directory in Python?

3条回答
  •  猫巷女王i
    2020-12-13 17:28

    You can try doing:

    import os
    path = os.getenv('APPDATA')
    array = os.listdir(path)
    print array
    

提交回复
热议问题