Skip to content

Commit

Permalink
exe launching fix
Browse files Browse the repository at this point in the history
  • Loading branch information
petabite committed Jul 28, 2019
1 parent 7d6fae7 commit db308b4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pylapse.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import threading
import time
import datetime
import os

pylapse_font = ('Trebuchet', 14)

Expand Down Expand Up @@ -219,8 +220,18 @@ def refresh_info_toplevel(self, interval_in_sec, total_shots, shoot_duration):
self.cancel_button.pack_forget()

if __name__ == '__main__':
def resource_path(relative_path):
""" Get absolute path to resource, works for dev and for PyInstaller """
try:
# PyInstaller creates a temp folder and stores path in _MEIPASS
base_path = sys._MEIPASS
except Exception:
base_path = os.path.abspath(".")

return os.path.join(base_path, relative_path)

#place MainScreen in pylapse root window and start mainloop
root = PyLapse()
root.iconbitmap('C:/Users/Philip/Desktop/code/pylapse/releases/pylapse.ico')
root.iconbitmap(resource_path('releases\pylapse.ico'))
MainScreen(root).pack()
root.mainloop()
Binary file added releases/pylapse-v1.0.1.exe
Binary file not shown.
Binary file added releases/pylapse-v1.0.1.zip
Binary file not shown.

0 comments on commit db308b4

Please sign in to comment.