1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

Allow Windows executable to be invoked from any cwd

This commit is contained in:
Jonathan Harris 2019-09-30 23:33:19 +01:00 committed by Athanasius
parent 9eb4dbd93e
commit d71e3445c7

View File

@ -23,6 +23,9 @@ if getattr(sys, 'frozen', False):
# Under py2exe sys.path[0] is the executable name
if platform == 'win32':
chdir(dirname(sys.path[0]))
# Allow executable to be invoked from any cwd
environ['TCL_LIBRARY'] = join(dirname(sys.path[0]), 'lib', 'tcl')
environ['TK_LIBRARY'] = join(dirname(sys.path[0]), 'lib', 'tk')
import tkinter as tk
from tkinter import ttk