Skip to content

Commit

Permalink
Update File Path
Browse files Browse the repository at this point in the history
  • Loading branch information
davidinations committed Mar 30, 2024
1 parent 2ed6b3b commit 54d37ec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/features.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import csv
import os

path = "../data/data.csv"
# Get the absolute path to the directory of the current script file
script_dir = os.path.dirname(os.path.abspath(__file__))

# Go up one level to get the base path
base_path = os.path.dirname(script_dir)

# Define the path to the csv file
path = os.path.join(base_path, 'data', 'data.csv')

def nik_validate(data_nik):
"""
Expand Down
22 changes: 18 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import features as ft
import tkinter
import re
import os
import babel.numbers
from tkinter import *
from tkinter import ttk
Expand All @@ -13,9 +14,22 @@
# Initialize the mixer module
pygame.mixer.init()

click_sound = pygame.mixer.Sound("../assets/sounds/Click.wav")
error_sound = pygame.mixer.Sound("../assets/sounds/Error.wav")
success_sound = pygame.mixer.Sound("../assets/sounds/Success.wav")
# Get the absolute path to the directory of the current script file
script_dir = os.path.dirname(os.path.abspath(__file__))

# Go up one level to get the base path
base_path = os.path.dirname(script_dir)

# Construct the paths to the sound files
click_sound_path = os.path.join(base_path, "assets", "sounds", "Click.wav")
error_sound_path = os.path.join(base_path, "assets", "sounds", "Error.wav")
success_sound_path = os.path.join(base_path, "assets", "sounds", "Success.wav")
icon_path = os.path.join(base_path, "assets", "images", "favicon.ico")

# Load the sounds Into Variables
click_sound = pygame.mixer.Sound(click_sound_path)
error_sound = pygame.mixer.Sound(error_sound_path)
success_sound = pygame.mixer.Sound(success_sound_path)

def sort_data(treeview, column, reverse):
"""
Expand Down Expand Up @@ -677,7 +691,7 @@ def exit_menu():
# create a windows
root = tkinter.Tk()
# config icon windows
root.iconbitmap("../assets/images/favicon.ico")
root.iconbitmap(icon_path)
# config size windows
root.geometry("1280x720+150-50") # <width>x<height>+<x_position>+<y_position>
# make a windows size fixed
Expand Down

0 comments on commit 54d37ec

Please sign in to comment.