Created
July 23, 2021 09:03
-
-
Save Priler/19e93c2a732e7a825a238135c5ea9122 to your computer and use it in GitHub Desktop.
Python get weekday (with calendar module, + localized)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
import calendar | |
import locale | |
locale.setlocale(locale.LC_ALL, 'ru_RU') | |
today = date.today() | |
print("Сегодня {}й день недели, {}!".format( | |
today.weekday(), | |
calendar.day_name[today.weekday()])) | |
# Сегодня 4й день недели, пятница! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment