Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Commit

Permalink
Make launch pyinstaller compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Jan 15, 2023
1 parent acaab11 commit f37f945
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

# Modules
import os
import sys
import json
from flask import Flask

# Initialization
config_file = os.path.join(os.path.dirname(__file__), "config.json")
tdir = os.path.dirname(__file__ if not getattr(sys, "frozen", False) else sys.executable)
config_file = os.path.join(tdir, "config.json")
if not os.path.isfile(config_file):
exit("Missing configuration file!")
sys.exit("Missing configuration file!")

with open(config_file, "r") as fh:
data = json.loads(fh.read())
Expand Down

0 comments on commit f37f945

Please sign in to comment.