Answers:
告诉我,“最新”是否表示11.10附带的功能,但这是在此处使用该功能的方法:
>>> from hello_lib.helpers import get_media_file
>>> get_media_file("hello.svg")
file:////home/stefano/hello/data/media/hello.svg
“ hello.svg”可以是路径的任何片段(如../media/hello.svg或stuff/hello.svg)。即get_media_file(f)相当于
"file://" + os.path.join(get_data_path(), "media", f)
并get_data_path()会返回/home/stefano/hello/data。
这些功能在hello/hello_lib/helpers.py和中定义hello/hello_lib/helloconfig.py。