简体   繁体   English

如何在PyGtk LinkBut​​ton中为本地文件指定URI

[英]How to Specify URI to a local File in PyGtk LinkButton

I need to create a link button (gtk.LinkButton) with an URI to a local file. 我需要创建一个带有本地文件URI的链接按钮(gtk.LinkBut​​ton)。 Does anyone know what is a valid URI format for a local file ? 有谁知道本地文件的有效URI格式是什么? I want to specify a relative folder example: ../some_folder/file_i_need_to_open.txt 我想指定一个相对的文件夹示例:../some_folder/file_i_need_to_open.txt

If this is can't be done, I don't mind putting the file in the same folder as the python source code =) 如果无法做到这一点,我不介意将文件与python源代码放在同一文件夹=)

Thank you. 谢谢。

Something like: file:///usr/bin/ is generally used for local URI. 诸如: file:///usr/bin/的东西通常用于本地URI。 But maybe just /usr/bin/ works too. 但是也许/usr/bin/也可以。 Have you tried it? 你试过了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM