使用Pycharm獲取Resources目錄裏的內容






def
get_resource_path(path: str) -> str: """\ 獲取Resources目錄裏的資源 :param path: :return: """ return os.path.abspath(os.path.normpath(f"resources/{path}"))

 

 可以通過上面的方法獲取

 

 

可以瞭解下 os.path,os.getcwd(),pathlib庫的使用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章