I'm new to Python, so forgive my ignorance I'm using pysimplegui to build a project tracker to help organize my work.
I've tried manually converting each date value within the list, but it tends to print the values incorrectly, and breaks them out of the list, when I'm trying to build the table.
I'm hoping there is a global way to change the date format used from "Timestamp" to "Date" or "Datetime".
My current code:
import PySimpleGUI as sg
import pandas as pd
from datetime import datetime
Excel_Read = pd.read_excel('C:\pythonProject\Schedule\Project_Schedule.xlsx', sheet_name='Schedule')
schedule_headings = ['Priority', 'Project_Name','Project_Num','Due_Date','Sales','Engineer','PM/PC' ]
Schedule_Table = pd.DataFrame(schedule_headings)
Schedule_List = Excel_Read.values.tolist()
def create_schedule(schedule_info_array, schedule_headings):
schedule_info_window_layout = [
[sg.Table(values=Schedule_List, headings=schedule_headings, max_col_width=35,
auto_size_columns=True,
display_row_numbers=False,
justification='Left',
num_rows=10,
enable_events=True,
enable_click_events=True,
key='-SCHEDULE_TABEL-',
row_height=35)]
]
Schedule_info_window = sg.Window('Schedule Info', schedule_info_window_layout, modal=True)
while True:
event, values = Schedule_info_window.read()
if event in (sg.WINDOW_CLOSED, 'Exit'):
break
if event == '-SCHEDULE_TABEL-':
print(values['-SCHEDULE_TABEL-'][0])
#name = Schedule_List[(values['-SCHEDULE_TABEL-'][0])][4],
#print(type(Schedule_List[0][3]))
#print(Schedule_List)