将工作日作为区域设置的全名添加到我的程序欢迎消息

2024-03-29 06:42:26 发布

您现在位置:Python中文网/ 问答频道 /正文

为了好玩,我想加上Hello!当我的程序在终端打开时,祝“星期一”快乐(例如)

我一直在使用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 ('\033[91m' + "This will only work until midnight and can only be three integers eg. 023" + '\033[0m')
print("=" * 80)

如果这真的很明显,我道歉——我只是边走边学,试图在问题出现时解决问题

谢谢你的帮助:)


Tags: topathimport程序projectonlyhelloinput