From 6027e4e3b15430ede92aaa75d619666e38c1b0f7 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Sun, 16 Aug 2009 10:38:10 -0400 Subject: [PATCH] fixed ref --- comprehensions.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comprehensions.html b/comprehensions.html index 785d9e7..4a382d2 100644 --- a/comprehensions.html +++ b/comprehensions.html @@ -180,7 +180,7 @@ body{counter-reset:h1 3}

Constructing Absolute Pathnames

-

In the previous example, the glob.glob() function returned a list of relative pathnames. The first example had pathnames like 'examples\feed.xml', and the second example had even shorter relative pathnames like 'romantest1.py'. As long as you stay in the same current working directory, these relative pathnames will work for opening files or getting file metadata. But if you want to construct an absolute pathname — i.e. one that includes all the directory names back to the root directory or drive letter — then you’ll need the os.path.realpath() function. +

In the previous section, the glob.glob() function returned a list of relative pathnames. The first example had pathnames like 'examples\feed.xml', and the second example had even shorter relative pathnames like 'romantest1.py'. As long as you stay in the same current working directory, these relative pathnames will work for opening files or getting file metadata. But if you want to construct an absolute pathname — i.e. one that includes all the directory names back to the root directory or drive letter — then you’ll need the os.path.realpath() function.

 >>> import os