Find directory name of file?

jmdeschamps at gmail.com jmdeschamps at gmail.com
Sun Jan 29 13:58:57 EST 2006


veracon wrote:
> I'm pretty new at Python, so I have no idea how to do this: How do I
> find the name of the directory that contains the application currently
> being executed (e.g. if the file is /home/user/file.py, I want to get
> the /home/user part)?
> 
> Thanks!

look into os.path module for help




More information about the Python-list mailing list