Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Day of Week Issue
-
So I have a problem. I've thought and thought and googled and googled.
If today is Saturday... I want to set up a list (or possibly dictionary) whereas the order will follow as Saturday, Sunday, Monday, etc. this needs to reapply every time I run the script. That list will end with Friday if I ran it on a Saturday...
I can obviously get the weekday using datetime. How do I apply that? How do I simplify the instruction to create the list?
-
import datetime as dt now = dt.datetime.now() the_daze = [(now + dt.timedelta(days=i)).strftime('%A') for i in xrange(7)] print(the_daze)
-
Thank you, ccc.