Skip to content

Instantly share code, notes, and snippets.

@ernado
Created January 16, 2014 06:33
Show Gist options
  • Select an option

  • Save ernado/8450679 to your computer and use it in GitHub Desktop.

Select an option

Save ernado/8450679 to your computer and use it in GitHub Desktop.
if not hasattr(sys, "argv") or not sys.argv[0]:
sys.argv = ["."]
try:
__file__ = os.path.dirname(os.path.abspath(sys.argv[0]))
os.chdir(__file__)
except OSError:
print "#! Incorrect launch!"
time.sleep(6)
sys.path.insert(0, "library")
reload(sys).setdefaultencoding("utf-8")
socket.setdefaulttimeout(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment