[Zope] Change current path in External Method

Passin, Tom tpassin@mitretek.org
Mon, 30 Dec 2002 10:56:17 -0500


[ Jo Meder]

> Am 28.12.2002, 14:25 Uhr
> 	schr=E4b Klimovich Alexander <klima@belsoft.by>:
>=20
> > Can anyone tell me how to change system current folder using python=20
> > methods?
>=20
> Actually the best source for questions like this is <gasp> the python
> documentation: http://www.python.org/doc/
>=20

However, I strongly suggest that you not actually change the current =
directory, since other modules will not know that you changed it.  If =
any of them depend on the actual value of the current working directory =
(shame on them!) they will be in trouble.

If you know the absolute path, just use that.  If you need a path =
relative to your module,  you can get the module to tell you where it =
(or its owing package) is located and construct paths relative to that - =
that too is in the Python docs. =20

The os library module has good functions for working with paths.  See =
the docs.

Cheers,

Tom P