Kris Deugau <kdeu...@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


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87zkpygmvh....@benfinney.id.au

Reply via email to