def modulePath():
 try:
  _ = (sys.executable if weAreFrozen() else __file__)
 except NameError:
  _ = inspect.getsourcefile(modulePath)
 return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=(sys.getfilesystemencoding() or UNICODE_ENCODING))

def modulePath ( ) : try : _ = ( sys . executable if weAreFrozen ( ) else __file__ ) except NameError : _ = inspect . getsourcefile ( modulePath ) return getUnicode ( os . path . dirname ( os . path . realpath ( _ ) ) , encoding = ( sys . getfilesystemencoding ( ) or UNICODE_ENCODING ) )
this will get us the programs directory .