-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9983233
commit 85aab6d
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Setup Conda and Run PyInstaller | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.11 # Specify the Python version you need | ||
activate-environment: myenv | ||
#environment-file: environment.yml # Optional: if you have an environment file | ||
auto-update-conda: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
conda install -c conda-forge fiona gdal openpyxl matplotlib click pyqt mamba geopandas pyinstaller | ||
- name: Run PyInstaller | ||
run: | | ||
pyinstaller tk_main.py tk_main.spec | ||
- name: Archive build artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pyinstaller-artifacts | ||
path: dist/ # Adjust the path according to where PyInstaller outputs the files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import tkinter as tk | ||
from tkinter import filedialog, messagebox | ||
import pandas as pd | ||
from tkinter import ttk | ||
|
||
|
||
class App(tk.Tk): | ||
def __init__(self): | ||
super().__init__() | ||
self.title("File Loader") | ||
self.geometry("800x600") | ||
|
||
self.btn_load_file = tk.Button(self, text="Load File", command=self.load_file) | ||
self.btn_load_file.pack(pady=20) | ||
|
||
self.table_frame = tk.Frame(self) | ||
self.table_frame.pack(fill=tk.BOTH, expand=True) | ||
|
||
def load_file(self): | ||
file_path = filedialog.askopenfilename(filetypes=[("CSV Files", "*.csv"), ("All Files", "*.*")]) | ||
if file_path: | ||
self.load_data(file_path) | ||
|
||
def load_data(self, file_path): | ||
try: | ||
data = pd.read_csv(file_path) | ||
self.display_table(data) | ||
except Exception as e: | ||
messagebox.showerror("Error", f"Failed to load file:\n{e}") | ||
|
||
def display_table(self, data): | ||
for widget in self.table_frame.winfo_children(): | ||
widget.destroy() | ||
|
||
tree = ttk.Treeview(self.table_frame, columns=list(data.columns), show="headings") | ||
tree.pack(fill=tk.BOTH, expand=True) | ||
|
||
for col in data.columns: | ||
tree.heading(col, text=col) | ||
tree.column(col, anchor=tk.W) | ||
|
||
for index, row in data.iterrows(): | ||
tree.insert("", tk.END, values=list(row)) | ||
|
||
|
||
if __name__ == "__main__": | ||
app = App() | ||
app.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
|
||
a = Analysis( | ||
['tk_main.py'], | ||
pathex=[], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
hooksconfig={}, | ||
runtime_hooks=[], | ||
excludes=[], | ||
noarchive=False, | ||
optimize=0, | ||
) | ||
pyz = PYZ(a.pure) | ||
|
||
exe = EXE( | ||
pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.datas, | ||
[], | ||
name='tk_main', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=False, | ||
disable_windowed_traceback=False, | ||
argv_emulation=False, | ||
target_arch=None, | ||
codesign_identity=None, | ||
entitlements_file=None, | ||
) |