打开和保存文件/文件夹的便利功能
uifunc的Python项目详细描述
提供以下便利功能
文件对话
根据可用性,这些对话使用tk、wxpython或qt4。 如果返回到tk,则foldersselector multi folder selector不 工作。
@FileSelector(['py','pyc','pyx'])defopen_python_file(file_path:str)->Any:# here the file you select is in file_pathwithopen(file_path,'r')asfp:# do something
@FilesSelector(['py','pyc','pyx'])defopen_python_file(file_paths:List[str])->Any:# here the file you select is in the list file_pathsforfile_pathinfile_paths:withopen(file_path,'r')asfp:# do something
@FolderSelectordefopen_python_file(folder_path:str)->Any:# here the folder you select is in the list folder_pathforfile_entryinscandir(folder_path):# do something
@FoldersSelectordefopen_python_file(folder_paths:List[str])->Any:# here multiple folder paths in the variable# do something
另外
SaveFolderSelector# selects a single folder for savingSaveSelector# selects a single file for saving