I recently downlaoded a game on pydev.org. The code below is the code that you run for the game to play. My question is does the likes of os.path.dirname(__file__)
mean? I have created games in python before but i always made them in the one class. Where as in this game this is outside of the folder where all the other classes are?
Can any1 help me. I have researched this but to no luck!
import sys
import os
try:
__file__
except NameError:
pass
else:
libdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'lib'))
sys.path.insert(0, libdir)
sys.path.insert(1, "lib")
import main
main.main()
__file__
" and "python os.path.dirname" return relevant pages describing each. – Josh Petrie Feb 1 '12 at 16:07