ConfigParser and multiple option names

Edward Elliott nobody at 127.0.0.1
Tue May 2 22:15:26 CEST 2006


Florian Lindner wrote:
> I think the best solution would be to use a seperation character:
> 
> dir="/home/florian, /home/john, home/whoever"
> 
> What character would be best to work on various operating systems? (of
> what names may a path consist is the question)

I don't think there are any universally-disallowed chars for path names. 
But I also haven't seen anyone mention os.pathsep yet.  Seems like the best
choice for a separator char.  If you need to run on multiple platforms,
your choices seem to be:

1. pick a legal-on-some-systems-but-uncommon-on-all char for dir names as a
separator (iirc osx uses : in paths so ; might have to do)
2. use os.pathsep to write platform-specific config files
3. do it another way




More information about the Python-list mailing list