added module check

main
Justus Jan Nico Wolff 2024-05-28 17:03:38 +02:00
parent 5eeabda3af
commit f616d1daa4
2 changed files with 19 additions and 3 deletions

20
main.py
View File

@ -1,6 +1,24 @@
import sys
# Justus Jan Nico Wolff
sys.dont_write_bytecode = True
import subprocess
import pkg_resources
import ast
required = open("requirements.txt", 'r')
required = ast.literal_eval(required.read())
installed = {pkg.key for pkg in pkg_resources.working_set}
missing = required - installed
if missing:
while True:
ans = input(f"Einige benötigte Module sind nicht installiert ({missing}), installieren per pip? Y/N ")
if ans == "y":
python = sys.executable
subprocess.check_call([python, '-m', 'pip', 'install', *missing], stdout=subprocess.DEVNULL)
break
elif ans == "n":
exit()
import mtTkinter as tk
from tkinter import ttk as tkk
from tkinter import messagebox
@ -34,8 +52,6 @@ else:
if len(sys.argv) == 2:
if sys.argv[1] == "NOLANG":
replacelh()
import ast
import subprocess
import time
import shutil
import os

View File

@ -1 +1 @@
["easygui", "simpleaudio", "tkinter"]
{"easygui", "simpleaudio"}