[Tutor] Mac to UNIX and back again (what to do about path)

Sheila King sheila@thinkspot.net
Tue, 10 Jul 2001 14:47:16 -0700


On Wed, 11 Jul 2001 06:21:23 +0900, "kevin parks" <kp87@lycos.com>
wrote about [Tutor] Mac to UNIX and back again (what to do about path):

:I have some scripts that i want to be able to run on both Mac OS 9 and under UNIX (the UNIX distribution on Mac OS X). I've managed to get the line endings thing somewhat under control with a little drag an drop changer app, but i don't know what to do 
about the path separator. On Mac it is (as you know ':' and UNIX is '/'. I'd really like to have one script that works on both. 

Try looking at the os module and its submodules (such as os.path).
http://www.python.org/doc/current/lib/module-os.html

Notice that os.sep is the path separator for the system on which the
script is currently running.

Also, there are commands for joining paths with file names correctly and
so on in this module.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/