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

Re: installing an end user editable file



Kris Deugau <kdeugau@vianet.ca> writes:

> 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 […]

You understand correctly. James has confused absolute paths with
relative paths.

-- 
 \              “Programs must be written for people to read, and only |
  `\        incidentally for machines to execute.” —Abelson & Sussman, |
_o__)              _Structure and Interpretation of Computer Programs_ |
Ben Finney


Reply to: