实战PyQt5: 124-在应用中访问系统的标准路径( 二 )
Windows系统下:
DesktopLocation:"C:/Users//Desktop"DocumentsLocation:"C:/Users//Documents"FontsLocation:"C:/Windows/Fonts" (不可写)ApplicationsLocation:"C:/Users//AppData/Roaming/Microsoft/Windows/Start Menu/Programs"MusicLocation:"C:/Users//Music"MoviesLocation:"C:/Users//Videos"PicturesLocation:"C:/Users//Pictures"TempLocation:"C:/Users//AppData/Local/Temp"HomeLocation:"C:/Users/"DataLocation:"C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data", "/data/"CacheLocation:"C:/Users//AppData/Local//cache"GenericDataLocation:"C:/Users//AppData/Local", "C:/ProgramData", "", "/data"RuntimeLocation:"C:/Users/"ConfigLocation:"C:/Users//AppData/Local/", "C:/ProgramData/"GenericConfigLocation:"C:/Users//AppData/Local", "C:/ProgramData"DownloadLocation:"C:/Users//Documents"GenericCacheLocation:"C:/Users//AppData/Local/cache"AppDataLocation:"C:/Users//AppData/Roaming/", "C:/ProgramData/", "", "/data", "/data/"AppLocalDataLocation:"C:/Users//AppData/Local/", "C:/ProgramData/", "", "/data", "/data/"AppConfigLocation:"C:/Users//AppData/Local/", "C:/ProgramData/"
Linux系统下:DesktopLocation:"~/Desktop"DocumentsLocation:"~/Documents"FontsLocation:"~/.fonts", "~/.local/share/fonts", "/usr/local/share/fonts", "/usr/share/fonts"ApplicationsLocation:"~/.local/share/applications", "/usr/local/share/applications", "/usr/share/applications"MusicLocation:"~/Music"MoviesLocation:"~/Videos"PicturesLocation:"~/Pictures"TempLocation:"/tmp"HomeLocation:"~"DataLocation:"~/.local/share/", "/usr/local/share/", "/usr/share/"CacheLocation:"~/.cache/"GenericDataLocation:"~/.local/share", "/usr/local/share", "/usr/share"RuntimeLocation:"/run/user/"ConfigLocation:"~/.config", "/etc/xdg"GenericConfigLocation:"~/.config", "/etc/xdg"DownloadLocation:"~/Downloads"GenericCacheLocation:"~/.cache"AppDataLocation:"~/.local/share/", "/usr/local/share/", "/usr/share/"AppLocalDataLocation:"~/.local/share/", "/usr/local/share/", "/usr/share/"AppConfigLocation:"~/.config/", "/etc/xdg/"
macOS系统下:DesktopLocation:"~/Desktop"DocumentsLocation:"~/Documents"FontsLocation:"/System/Library/Fonts" (不可写入)ApplicationsLocation:"/Applications" (不可写入)MusicLocation:"~/Music"MoviesLocation:"~/Movies"PicturesLocation:"~/Pictures"TempLocation:由系统随机生成HomeLocation:"~"DataLocation:"~/Library/Application Support/", "/Library/Application Support/". "/../Resources"CacheLocation:"~/Library/Caches/", "/Library/Caches/"GenericDataLocation:"~/Library/Application Support", "/Library/Application Support"RuntimeLocation:"~/Library/Application Support"ConfigLocation:"~/Library/Preferences"GenericConfigLocation:"~/Library/Preferences"DownloadLocation: "~/Downloads"GenericCacheLocation:"~/Library/Caches", "/Library/Caches"AppDataLocation:"~/Library/Application Support/", "/Library/Application Support/". "/../Resources"AppLocalDataLocation:"~/Library/Application Support/", "/Library/Application Support/". "/../Resources"AppConfigLocation:"~/Library/Preferences/"
QStandardPaths常用函数- findExecutable(executableName, paths):在指定的路径中查找名为executableName的可执行文件 , 如果paths为空 , 则在系统路径中查找 。系统路径指PATH环境变量的值 。如果存在 , 返回可执行文件的绝对文件路径 , 如果没有找到 , 则返回空字符串 。
- displayName(type: 'QStandardPaths.StandardLocation'):根据标准目录类型 , 返回对应的本地名称 , 如果找不到 , 返回空字符串 。例如指定type为DesktopLocation , 则返回桌面名称;DocumentsLocation , 则返回文档目录名称 。
- locate(type, str, options):根据标准目录类型 , 在该目录中查找名为fileName的文件或目录 。返回找到的第一个文件或目录的完整路径(取决于options) 。如果找不到这样的文件或目录 , 则返回一个空字符串 。 如果某一种类型的系统标准目录可能会有多个路径 , 因此 , 系统会按照顺序查找这些路径中的文件或目录 。例如QStandardPaths.DataLocation , 数据文件类型目录就有多个路径与之对应 。 函数会依次查询standardLocations接口返回的路径列表中所匹配的文件 。
- Wireshark数据包分析实战:TCP报文段重组
- Python爬虫采集网易云音乐热评实战
- Django实战016:django中使用redis详解
- HTTP实战之Wireshark抓包分析
- Wireshark数据包分析实战:网卡卸载
- Python数据分析:数据可视化实战教程
- 实战经验:电商平台遭遇CC攻击,我们是如何应对的?
- Tencent IN对话 | 八位互联网实战家,实战智慧营销商学院
- HLS实战之Wireshark抓包分析
- Vue实战091:Vue项目部署到nginx服务器