Cloud Scale

The rarified atmosphere of cloud design.

Jamieson Becker is the CEO of LabArts Corporation and specializes in Internet-scale systems.

Sunday, October 19, 2008

 

Finding actual path of a python script

Python guru ironfroggy pointed out a quick way to pull the path of the module you are located in (aside from sys.modules['__main__'], which doesn't always work) is os.path.abspath(os.path.dirname(__file__)).

Comments:
os.path.abspath(os.path.dirname(__file__))
 
That works, thanks!!
 

Post a Comment



Links to this post:

Create a Link



<< Home

Archives

June 2008   July 2008   August 2008   October 2008   December 2008  



This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]