Environment vars

dn PythonList at DancesWithMice.info
Wed Nov 25 13:00:02 EST 2020


On 26/11/2020 05:46, Bob van der Poel wrote:
> I've got a program which accepts an optional env variable listing a single
> or multiple directory for the app to use. I've done a bit of a search and
> see both a comma and semicolon being used/suggested as a path separator.
> Any consensus on which is better?
> 
>     MYPATHS=foo,bar,woof
> or
>      MYPATHS=foo;bar;woof
> And, certainly not
>      MYPATHS=foo,bar;woof
> 
> I did think I could be clever and check to see if the string contained a ,
> or ; and spit it accordingly, but then what if the reason (hopefully,
> pretty damned unlikely!) that a , or ; is being used as part of a path name?


Is this a Python question? ie the above code should be run inside the 
Python interpreter (it won't).

MS-Windows has an option to use a comma or a semi-colon as a 
list-separator on the 'command line' - as a local/locale definition, but 
there are caveats.

Alternately, did you mean that the above is part of a data-file?
-- 
Regards =dn


More information about the Python-list mailing list