Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28772

Re: Does os.getcwd() and os.curdir have the same effect ?

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <t@jollybox.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.017
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'python': 0.09; "'.'": 0.09; 'os.getcwd()': 0.09; 'path,': 0.09; 'subject:Does': 0.09; 'subject:same': 0.09; 'os.curdir': 0.16; 'subject:effect': 0.16; 'later': 0.16; 'wrote:': 0.17; 'directory.': 0.17; '>>>': 0.18; 'import': 0.21; 'absolute': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'subject: ?': 0.30; 'expect': 0.31; 'directory,': 0.33; 'to:addr:python-list': 0.33; "can't": 0.34; 'pm,': 0.35; 'but': 0.36; 'does': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'received:62': 0.62; 'land': 0.62; 'more': 0.63; 'subject:have': 0.79; 'from:addr:t': 0.84; 'received:62.75': 0.84
Date Sun, 09 Sep 2012 15:39:12 +0200
From Thomas Jollans <t@jollybox.de>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Does os.getcwd() and os.curdir have the same effect ?
References <12b64802-d598-441b-b3cd-87ec17bba514@googlegroups.com>
In-Reply-To <12b64802-d598-441b-b3cd-87ec17bba514@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.417.1347197960.27098.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1347197960 news.xs4all.nl 6858 [2001:888:2000:d::a6]:58051
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28772

Show key headers only | View raw


On 09/09/2012 03:22 PM, iMath wrote:
> Does os.getcwd() and os.curdir have the same effect ?
> 

Python 3.2.3 (default, May  3 2012, 15:51:42)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getcwd()
'/home/tjol'
>>> os.curdir
'.'
>>>


No.


Both refer to the current directory, but os.curdir is not an absolute
path, so you can't chdir() to it later and expect to land it the
original directory.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Does os.getcwd() and os.curdir have the same effect ? iMath <redstone-cold@163.com> - 2012-09-09 06:22 -0700
  Re: Does os.getcwd() and os.curdir have the same effect ? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-09 13:38 +0000
  Re: Does os.getcwd() and os.curdir have the same effect ? Thomas Jollans <t@jollybox.de> - 2012-09-09 15:39 +0200
    Re: Does os.getcwd() and os.curdir have the same effect ? iMath <redstone-cold@163.com> - 2012-09-26 23:26 -0700
    Re: Does os.getcwd() and os.curdir have the same effect ? iMath <redstone-cold@163.com> - 2012-09-26 23:26 -0700

csiph-web