Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!zen.net.uk!hamilton.zen.co.uk!reader01.nrc01.news.zen.net.uk.POSTED!not-for-mail From: Nobody Subject: Re: Why doesn't Python remember the initial directory? Date: Mon, 20 Aug 2012 01:45:22 +0100 User-Agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.) Message-Id: Newsgroups: comp.lang.python References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lines: 12 Organization: Zen Internet NNTP-Posting-Host: 80b3e161.news.zen.co.uk X-Trace: DXC=HlGgXNjG5Vb=5nNoc]7 You can obtain the working directory with os.getcwd(). Maybe. On Unix, it's possible that the current directory no longer has a pathname. As with files, directories can be "deleted" (i.e. unlinked) even while they're still in use. Similarly, a directory can be renamed while it's in use, so the current directory's pathname may have changed even while the current directory itself hasn't.