Skip to content
Snippets Groups Projects
Commit dabfdcaf authored by Toumji Abdallah's avatar Toumji Abdallah
Browse files

Handled xlsx and csv file for the importation of data

parent 1da4264f
No related branches found
No related tags found
No related merge requests found
......@@ -327,7 +327,16 @@ class Form:
:param path: str
The path of the file containing the data.
"""
if path.split('.')[-1] == 'tsv':
self.table.model.df = pd.read_csv(path, sep='\t')
elif path.split('.')[-1] == 'csv':
self.table.model.df = pd.read_csv(path)
elif path.split('.')[-1] == 'xlsx':
self.table.model.df = pd.read_excel(path)
else:
mb.showinfo('Invalid file',
'The file must be a tsv, csv or xlsx file.')
return
self.table.redraw()
self.confirmation_button.grid_forget()
self.validation_label.grid_forget()
......
......@@ -27,6 +27,7 @@ class Application(tk.Frame):
""" The constructor of the class, it instantiates the main window of the application.
"""
tk.Frame.__init__(self, root)
root.title('BIDS Handler')
self.root = root
self.create_widgets()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment