[Python-ideas] os.path.abspath - optional startdir argument

Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de
Thu Jul 24 17:30:58 CEST 2014


On 24.07.2014 17:21, Juancarlo Añez wrote:
>
> On Thu, Jul 24, 2014 at 9:15 AM, Wolfgang Maier
> <wolfgang.maier at biologie.uni-freiburg.de
> <mailto:wolfgang.maier at biologie.uni-freiburg.de>>
> wrote:
>
>     os.path.normpath(os.path.join(__os.getcwd(),path)).
>
>     However, I'd find it useful, occasionally, to be able to specify a
>     starting directory other than the current working directory.
>
>
> os.path.normpath(os.path.join(config_dir, path))
>

As I said, I'm aware of this, but it's ugly and even uglier if you have 
to turn config_dir into an absolute path itself.

> Better yet, use the pathlib module.
>

As it stands, the pathlib module is only provisional plus, IMO, kind of 
overkill for a simple task like that.

> Cheers,
> Juancarlo *Añez*




More information about the Python-ideas mailing list