[Q]How to append paths in a platform-independent way?

Miki Tebeka tebeka at cs.bgu.ac.il
Wed Apr 2 03:35:47 EST 2003


Hello Daehyok,
> How to do the following jobs in a platform-independent way?
> 
> path = /home/sdhyok
> file = data.txt
> 
> 1. Append the file name to the path => /home/sdhyok/data.txt
> 2. Extract only path from /home/sdhyok/data.txt => /home/sdhyok
http://www.python.org/doc/current/lib/module-os.path.html

HTH.
Miki




More information about the Python-list mailing list