[Tutor] Working Directory

Russell Bungay rab121@york.ac.uk
Sat, 04 May 2002 11:51:21 +0100


Lloyd Kvam wrote:
>  >>> import mx.DateTime
>  >>> mx.DateTime.__file__
> 'F:\\Python22\\Lib\\site-packages\\mx\\DateTime\\__init__.pyc'

>I hope this fits the bill.  I believe that if the module comes from >your current directory, it simply returns the file name.

Thankyou, my code now looks like:

### gofish.py

import bmdutils,ConfigParser,os,os.path,sys

gofishdir = os.path.dirname(__file__)
sys.path.append(gofishdir)

import cards #module in same directory as gofish.py

etc

Thankyou very much,

Russell
--
http://www.bigmaddrongo.com
President of York University Trampoline Club:
http://york.trampolining.net
Chair of The York Glee Singers:
http://www.gleesingers.co.uk