import tkinter as tk
from tkinter import filedialog
import pandas as pd

class DataApplication:
    def __init__(self, window):
        self.window = window
        self.window.title("Data Processing Application")
        
        # Create labels
        self.load_label = tk.Label(window, text="Load CSV File")
        self.load_label.grid(row=0, column=0)

        # Create buttons
        self.load_button = tk.Button(window, text="Load CSV", command=self.load_csv)
        self.load_button.grid(row=0, column=1)

    def load_csv(self):
        file_path = filedialog.askopenfilename()
        try:
            self.df = pd.read_csv(file_path)
            tk.messagebox.showinfo('Success','CSV File Loaded Successfully')
        except Exception as e:
            tk.messagebox.showerror('Error', 'Failed to load CSV file: ' + str(e))

root = tk.Tk()
app = DataApplication(root)
root.mainloop()