Hi all,
I wrote a script that compares today’s date with an excel file creation date. my issue lies in whenever I want to run this with stlite sharing (shoutout to Yuichiro Tachibana @whitphx ). How to access a file’s metadata when running the script from the web browser? I’d appreciate if you could guide me on how to tackle this.
Regards,
A.A. Garcia
Below there’s a script that seems to work just fine in my local Desktop (using macOS, python-version=3.10.13 and streamlit-version=1.28.2).
import os
from datetime import date, datetime
FILENAME = ‘my_file.xlsx’
todays_date = date.today()
creation_time = os.stat(FILENAME).st_birthtime #this may not work out in stlite sharing
creation_date = datetime.fromtimestamp(creation_time).date()
if creation_date == todays_date:
print(f’todays date: {creation_date}')
else:
print(‘Dates are not the same’)