在我的程序欢迎消息中添加工作日作为语言环境的全名
Add Weekday as locale’s full name to my programs welcome message
所以为了一点乐趣我想补充你好!当我的程序在终端中打开时,我很高兴 "Monday"(例如)。
我一直在使用 strftime 指令来命名生成的文件夹。但是我有点卡住如何将它添加到打印功能中的打开消息中。
这是我目前所拥有的 -
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
from __future__ import print_function
import os
import datetime
try: #Handle Python 2.7
input = raw_input
except NameError:
pass
#Change Directory Paths to Project Drives
subfolders = ("ari", "sound", "md5" , "mxf" , "h264" , "reports" , "ale")
parent_format = "{0:03d}_{1:%y%m%d}_Unit_Project"
path = ('/Volumes/Macintosh HD/Users/thenightfactory/Documents')
path2 = ('/Volumes/Macintosh HD/Users/thenightfactory/Pictures')
os.chdir(path)
#Below is where I want to have the day come up
print ("")
print("Hello! Please Select A Shooting Day To Create Today's Folders:")
print ('3[91m' + "This will only work until midnight and can only be three integers eg. 023" + '3[0m')
print("=" * 80)
如果这真的很明显,我深表歉意 - 我只是一边学习一边尝试解决出现的问题。
感谢您的帮助:)
获取今天的工作日:
from datetime import datetime
weekday = datetime.strftime(datetime.now(), "%A")
print("Hello, happy " + weekday + "!")
所以为了一点乐趣我想补充你好!当我的程序在终端中打开时,我很高兴 "Monday"(例如)。
我一直在使用 strftime 指令来命名生成的文件夹。但是我有点卡住如何将它添加到打印功能中的打开消息中。
这是我目前所拥有的 -
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
from __future__ import print_function
import os
import datetime
try: #Handle Python 2.7
input = raw_input
except NameError:
pass
#Change Directory Paths to Project Drives
subfolders = ("ari", "sound", "md5" , "mxf" , "h264" , "reports" , "ale")
parent_format = "{0:03d}_{1:%y%m%d}_Unit_Project"
path = ('/Volumes/Macintosh HD/Users/thenightfactory/Documents')
path2 = ('/Volumes/Macintosh HD/Users/thenightfactory/Pictures')
os.chdir(path)
#Below is where I want to have the day come up
print ("")
print("Hello! Please Select A Shooting Day To Create Today's Folders:")
print ('3[91m' + "This will only work until midnight and can only be three integers eg. 023" + '3[0m')
print("=" * 80)
如果这真的很明显,我深表歉意 - 我只是一边学习一边尝试解决出现的问题。
感谢您的帮助:)
获取今天的工作日:
from datetime import datetime
weekday = datetime.strftime(datetime.now(), "%A")
print("Hello, happy " + weekday + "!")