Skip to content

Instantly share code, notes, and snippets.

@danishi
Created June 18, 2023 01:25
Show Gist options
  • Select an option

  • Save danishi/96be4ca21a0ed63190a3aa6974234985 to your computer and use it in GitHub Desktop.

Select an option

Save danishi/96be4ca21a0ed63190a3aa6974234985 to your computer and use it in GitHub Desktop.
Year Progress
import datetime
today = datetime.date.today()
#today = datetime.date(2023, 12, 31) # for testing
year_start = datetime.date(today.year, 1, 1)
year_end = datetime.date(today.year + 1, 1, 1)
year_progress = (today - year_start) / (year_end - year_start)
persent = str(round(year_progress * 100)) + '%'
progress_bar = '▓' * round(year_progress * 15) + '░' * (15 - round(year_progress * 15)) # 15 bars
print(progress_bar + ' ' + persent)
@danishi
Copy link
Author

danishi commented Jun 18, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment