win7 环境下: Python3.5默认安装路径是当前用户的 AppData\.. 下 这么做的一个可能原因是 现在安装过程中默认是install just for me,这个会把python默认安装到AppData文件夹中,如果选了install for all users,就会默认安装到C盘根目录了.这算是访问控制吧. python3.5 安装: 方法/步骤 输入官网https://www.python.org/,下载所需版本的安装包 双击下载好的安装包 自定义安装,并添加到
代码: import os path = r"C:\Users\Administrator\Desktop\***" print('filenum:',len([lists for lists in os.listdir(path) if os.path.isfile(os.path.join(path, lists))]))
Property name Brief description of property AdminToolsFolder Full path to the directory containing administrative tools for an individual user. AppDataFolder Full path to the Application Data folder for the current user. CommonAppDataFolder Full path