3.0.1 Release Preview 1
This commit is contained in:
@@ -14,5 +14,8 @@
|
||||
- Przeniesienie modułów do oddzielnego pliku
|
||||
- Stworzenie pliku 'format.py' ze skryptem przetwarzającym dane - przystosowanie programu do ewentualnych zmian w formacie plików z danymi
|
||||
- Przeniesienie ukrytych ustawień do pliku 'config.cfg'
|
||||
- ZNANE BŁĘDY: złe formatowanie tekstu
|
||||
|
||||
3.0.1
|
||||
- Poprawka błędu - pole 3 i 4 nie mają już przypisanej tej samej zmiennej tekstowej
|
||||
- Przydzielenie wersji, autorów, tytułu programu i lat pracy do zmiennych globalnych środowiska graficznego
|
||||
|
||||
|
||||
207
generator.py
207
generator.py
@@ -1,5 +1,5 @@
|
||||
# GeneratorCSV
|
||||
# Wersja 3.0
|
||||
# Wersja 3.0.1
|
||||
# by Mateusz Skoczek
|
||||
# luty 2019 - grudzień 2019
|
||||
# dla ZSP Sobolew
|
||||
@@ -290,123 +290,126 @@ def Main():
|
||||
|
||||
|
||||
## Inicjacja okna ###############################################################################
|
||||
def GUI():
|
||||
# Stałe
|
||||
SzerokoscOpisu = 17
|
||||
SzerokoscPola = 91
|
||||
|
||||
# Tworzenie okna
|
||||
OknoGlowne = tk.Tk()
|
||||
OknoGlowne.title('GeneratorCSV')
|
||||
OknoGlowne.resizable(width = False, height = False)
|
||||
# Zmienne globalne środowiska graficznego
|
||||
SzerokoscOpisu = 17
|
||||
SzerokoscPola = 91
|
||||
TytulProgramu = 'GeneratorCSV'
|
||||
Autorzy = 'Mateusz Skoczek'
|
||||
Wersja = '3.0.1'
|
||||
Lata = '2019'
|
||||
|
||||
# Nazwa programu
|
||||
Tytul = tk.Label(OknoGlowne, text = 'GeneratorCSV', font = ('Segoe UI Semilight', 20), borderwidth = 7, justify = 'center', bg = 'Gainsboro', width = 47)
|
||||
Tytul.grid(row = 0)
|
||||
# Tworzenie okna
|
||||
OknoGlowne = tk.Tk()
|
||||
OknoGlowne.title(TytulProgramu)
|
||||
OknoGlowne.resizable(width = False, height = False)
|
||||
|
||||
# Nazwa programu
|
||||
Tytul = tk.Label(OknoGlowne, text = TytulProgramu, font = ('Segoe UI Semilight', 20), borderwidth = 7, justify = 'center', bg = 'Gainsboro', width = 47)
|
||||
Tytul.grid(row = 0)
|
||||
|
||||
|
||||
# Tworzenie frame dla ścieżek plików do importu
|
||||
Ramka1 = tk.LabelFrame(OknoGlowne, text = 'Pliki do importu zawierające dane')
|
||||
Ramka1.grid(row = 1)
|
||||
# Tworzenie frame dla ścieżek plików do importu
|
||||
Ramka1 = tk.LabelFrame(OknoGlowne, text = 'Pliki do importu zawierające dane')
|
||||
Ramka1.grid(row = 1)
|
||||
|
||||
# Ścieżka pliku do importu 1
|
||||
wiersz1 = 0
|
||||
text1 = tk.StringVar()
|
||||
OpisPola1 = tk.Label(Ramka1, text = 'Plik z danymi (1)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola1.grid(row = wiersz1, column = 0)
|
||||
Pole1 = tk.Entry(Ramka1, textvariable = text1, width = SzerokoscPola)
|
||||
Pole1.grid(row = wiersz1, column = 1)
|
||||
def Browse1_Dialog():
|
||||
Browse1.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole1.delete(0, 'end')
|
||||
Pole1.insert(0, Browse1.filename)
|
||||
Browse1 = tk.Button(Ramka1, text = '...', command = Browse1_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse1.grid(row = wiersz1, column = 2, padx = 5, pady = 3)
|
||||
# Ścieżka pliku do importu 1
|
||||
wiersz1 = 0
|
||||
text1 = tk.StringVar()
|
||||
OpisPola1 = tk.Label(Ramka1, text = 'Plik z danymi (1)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola1.grid(row = wiersz1, column = 0)
|
||||
Pole1 = tk.Entry(Ramka1, textvariable = text1, width = SzerokoscPola)
|
||||
Pole1.grid(row = wiersz1, column = 1)
|
||||
def Browse1_Dialog():
|
||||
Browse1.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole1.delete(0, 'end')
|
||||
Pole1.insert(0, Browse1.filename)
|
||||
Browse1 = tk.Button(Ramka1, text = '...', command = Browse1_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse1.grid(row = wiersz1, column = 2, padx = 5, pady = 3)
|
||||
|
||||
# Ścieżka pliku do importu 2
|
||||
wiersz2 = 1
|
||||
text2 = tk.StringVar()
|
||||
OpisPola2 = tk.Label(Ramka1, text = 'Plik z danymi (2)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola2.grid(row = wiersz2, column = 0)
|
||||
Pole2 = tk.Entry(Ramka1, textvariable = text2, width = SzerokoscPola)
|
||||
Pole2.grid(row = wiersz2, column = 1)
|
||||
def Browse2_Dialog():
|
||||
Browse2.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole2.delete(0, 'end')
|
||||
Pole2.insert(0, Browse2.filename)
|
||||
Browse2 = tk.Button(Ramka1, text = '...', command = Browse2_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse2.grid(row = wiersz2, column = 2, padx = 5, pady = 3)
|
||||
# Ścieżka pliku do importu 2
|
||||
wiersz2 = 1
|
||||
text2 = tk.StringVar()
|
||||
OpisPola2 = tk.Label(Ramka1, text = 'Plik z danymi (2)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola2.grid(row = wiersz2, column = 0)
|
||||
Pole2 = tk.Entry(Ramka1, textvariable = text2, width = SzerokoscPola)
|
||||
Pole2.grid(row = wiersz2, column = 1)
|
||||
def Browse2_Dialog():
|
||||
Browse2.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole2.delete(0, 'end')
|
||||
Pole2.insert(0, Browse2.filename)
|
||||
Browse2 = tk.Button(Ramka1, text = '...', command = Browse2_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse2.grid(row = wiersz2, column = 2, padx = 5, pady = 3)
|
||||
|
||||
# Ścieżka pliku do importu 3
|
||||
wiersz3 = 2
|
||||
text3 = tk.StringVar()
|
||||
OpisPola3 = tk.Label(Ramka1, text = 'Plik z danymi (3)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola3.grid(row = wiersz3, column = 0)
|
||||
Pole3 = tk.Entry(Ramka1, textvariable = text3, width = SzerokoscPola)
|
||||
Pole3.grid(row = wiersz3, column = 1)
|
||||
def Browse3_Dialog():
|
||||
Browse3.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole3.delete(0, 'end')
|
||||
Pole3.insert(0, Browse3.filename)
|
||||
Browse3 = tk.Button(Ramka1, text = '...', command = Browse3_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse3.grid(row = wiersz3, column = 2, padx = 5, pady = 3)
|
||||
# Ścieżka pliku do importu 3
|
||||
wiersz3 = 2
|
||||
text3 = tk.StringVar()
|
||||
OpisPola3 = tk.Label(Ramka1, text = 'Plik z danymi (3)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola3.grid(row = wiersz3, column = 0)
|
||||
Pole3 = tk.Entry(Ramka1, textvariable = text3, width = SzerokoscPola)
|
||||
Pole3.grid(row = wiersz3, column = 1)
|
||||
def Browse3_Dialog():
|
||||
Browse3.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole3.delete(0, 'end')
|
||||
Pole3.insert(0, Browse3.filename)
|
||||
Browse3 = tk.Button(Ramka1, text = '...', command = Browse3_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse3.grid(row = wiersz3, column = 2, padx = 5, pady = 3)
|
||||
|
||||
# Ścieżka pliku do importu 4
|
||||
wiersz4 = 3
|
||||
text4 = tk.StringVar()
|
||||
OpisPola4 = tk.Label(Ramka1, text = 'Plik z danymi (4)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola4.grid(row = wiersz4, column = 0)
|
||||
Pole4 = tk.Entry(Ramka1, textvariable = text3, width = SzerokoscPola)
|
||||
Pole4.grid(row = wiersz4, column = 1)
|
||||
def Browse4_Dialog():
|
||||
Browse4.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole4.delete(0, 'end')
|
||||
Pole4.insert(0, Browse4.filename)
|
||||
Browse4 = tk.Button(Ramka1, text = '...', command = Browse4_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse4.grid(row = wiersz4, column = 2, padx = 5, pady = 3)
|
||||
# Ścieżka pliku do importu 4
|
||||
wiersz4 = 3
|
||||
text4 = tk.StringVar()
|
||||
OpisPola4 = tk.Label(Ramka1, text = 'Plik z danymi (4)', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPola4.grid(row = wiersz4, column = 0)
|
||||
Pole4 = tk.Entry(Ramka1, textvariable = text4, width = SzerokoscPola)
|
||||
Pole4.grid(row = wiersz4, column = 1)
|
||||
def Browse4_Dialog():
|
||||
Browse4.filename = TKfld.askopenfilename(initialdir="/", title="Wybierz plik", filetypes=(("Pliki txt", "*.txt"), ("Wszystkie pliki", "*.*")))
|
||||
Pole4.delete(0, 'end')
|
||||
Pole4.insert(0, Browse4.filename)
|
||||
Browse4 = tk.Button(Ramka1, text = '...', command = Browse4_Dialog, background = 'silver', relief = 'flat')
|
||||
Browse4.grid(row = wiersz4, column = 2, padx = 5, pady = 3)
|
||||
|
||||
|
||||
# Tworzenie frame dla plików export
|
||||
Ramka2 = tk.LabelFrame(OknoGlowne, text = 'Ustawienia eksportu')
|
||||
Ramka2.grid(row = 2)
|
||||
# Tworzenie frame dla plików export
|
||||
Ramka2 = tk.LabelFrame(OknoGlowne, text = 'Ustawienia eksportu')
|
||||
Ramka2.grid(row = 2)
|
||||
|
||||
# Ścieżka folderu do zapisu wygenerowanych plików
|
||||
text4 = tk.StringVar()
|
||||
OpisPolaExport = tk.Label(Ramka2, text = 'Lokalizacja', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPolaExport.grid(row = 0, column = 0)
|
||||
PoleExport = tk.Entry(Ramka2, textvariable = text4, width = SzerokoscPola)
|
||||
PoleExport.grid(row = 0, column = 1)
|
||||
def BrowseExport_Dialog():
|
||||
BrowseExport.filename = TKfld.askdirectory()
|
||||
PoleExport.delete(0, 'end')
|
||||
PoleExport.insert(0, BrowseExport.filename)
|
||||
BrowseExport = tk.Button(Ramka2, text = '...', command = BrowseExport_Dialog, background = 'silver', relief = 'flat')
|
||||
BrowseExport.grid(row = 0, column = 2, padx = 5, pady = 3)
|
||||
# Ścieżka folderu do zapisu wygenerowanych plików
|
||||
text4 = tk.StringVar()
|
||||
OpisPolaExport = tk.Label(Ramka2, text = 'Lokalizacja', justify = 'left', width = SzerokoscOpisu)
|
||||
OpisPolaExport.grid(row = 0, column = 0)
|
||||
PoleExport = tk.Entry(Ramka2, textvariable = text4, width = SzerokoscPola)
|
||||
PoleExport.grid(row = 0, column = 1)
|
||||
def BrowseExport_Dialog():
|
||||
BrowseExport.filename = TKfld.askdirectory()
|
||||
PoleExport.delete(0, 'end')
|
||||
PoleExport.insert(0, BrowseExport.filename)
|
||||
BrowseExport = tk.Button(Ramka2, text = '...', command = BrowseExport_Dialog, background = 'silver', relief = 'flat')
|
||||
BrowseExport.grid(row = 0, column = 2, padx = 5, pady = 3)
|
||||
|
||||
|
||||
# Przycisk START
|
||||
Przycisk = tk.Button(OknoGlowne, text = 'START', justify = 'center', width = 50, command = Main, relief = 'flat', background = 'silver')
|
||||
Przycisk.grid(row = 3, pady = 15)
|
||||
# Przycisk START
|
||||
Przycisk = tk.Button(OknoGlowne, text = 'START', justify = 'center', width = 50, command = Main, relief = 'flat', background = 'silver')
|
||||
Przycisk.grid(row = 3, pady = 15)
|
||||
|
||||
|
||||
# Pasek dolny
|
||||
PasekDolny = tk.LabelFrame(OknoGlowne, bd = 0, background = 'Gainsboro')
|
||||
PasekDolny.grid(row = 4)
|
||||
InfoLabel = tk.Label(PasekDolny, text = 'GeneratorCSV 3.0 | © Mateusz Skoczek 2019 dla ZSP Sobolew', justify = 'left', width = 93, anchor = 'w', background = 'Gainsboro')
|
||||
InfoLabel.grid(row= 0, column = 0)
|
||||
def InfoOpen():
|
||||
try:
|
||||
x = open('instrukcja.txt')
|
||||
except FileNotFoundError:
|
||||
MDerr(E001x03)
|
||||
else:
|
||||
os.system("notepad instrukcja.txt")
|
||||
Przycisk = tk.Button(PasekDolny, text = 'Instrukcja', justify = 'center', foreground = 'blue', relief = 'flat', command = InfoOpen, background = 'Gainsboro')
|
||||
Przycisk.grid(row = 0, column = 1)
|
||||
# Pasek dolny
|
||||
PasekDolny = tk.LabelFrame(OknoGlowne, bd = 0, background = 'Gainsboro')
|
||||
PasekDolny.grid(row = 4)
|
||||
info = TytulProgramu + ' ' + Wersja + ' | © ' + Autorzy + ' '+ Lata + ' dla ZSP Sobolew'
|
||||
InfoLabel = tk.Label(PasekDolny, text = info, justify = 'left', width = 93, anchor = 'w', background = 'Gainsboro')
|
||||
InfoLabel.grid(row= 0, column = 0)
|
||||
def InfoOpen():
|
||||
try:
|
||||
x = open('instrukcja.txt')
|
||||
except FileNotFoundError:
|
||||
MDerr(E001x03)
|
||||
else:
|
||||
os.system("notepad instrukcja.txt")
|
||||
Przycisk = tk.Button(PasekDolny, text = 'Instrukcja', justify = 'center', foreground = 'blue', relief = 'flat', command = InfoOpen, background = 'Gainsboro')
|
||||
Przycisk.grid(row = 0, column = 1)
|
||||
|
||||
|
||||
tk.mainloop()
|
||||
|
||||
GUI()
|
||||
tk.mainloop()
|
||||
|
||||
#_______________________________________________________________________________________________#
|
||||
|
||||
Reference in New Issue
Block a user