[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: installing an end user editable file



james frize wrote:
However, I can't open a file from /usr/share via my python script as I
don't have permission to open files in a protected directory

             print "loading links.txt from usr/share/doc/gtk-link-lizard..."
             try:
                 self.text_file =
open("usr/share/doc/gtk-link-lizard/links.txt","r")

Check your filesystem paths carefully; unless I totally misunderstand some bizarre aspect of Python syntax, you're trying to open "usr/share/doc/gtk-link-lizard/links.txt" relative to whatever the code thinks the current directory is, not the absolute path "/usr/share/doc/gtk-link-lizard/links.txt".

-kgd


Reply to: