Skip to content

Instantly share code, notes, and snippets.

@alekssamos
Created July 23, 2020 17:53
Show Gist options
  • Select an option

  • Save alekssamos/2c56151ba1ee9e0013b7849e1ccfad3f to your computer and use it in GitHub Desktop.

Select an option

Save alekssamos/2c56151ba1ee9e0013b7849e1ccfad3f to your computer and use it in GitHub Desktop.
_MEIPASS onefile
import os, sys
def resource(relative_path):
if getattr(sys, 'frozen', False):
return os.path.join(sys._MEIPASS, relative_path)
return os.path.join(os.path.abspath('.'), relative_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment