geekcomputers / geekcomputers/Python

Capitalize an output file name (date)

未关闭
#356 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
35.4k
派生
12.9k
平均合并
2 小时 37 分钟
30 天内合并 PR
1

描述

I have this code that results in: 2018_Aug_TCRArchive.pdf - a simple request has come in to capitalize the month... i.e. 2018_AUG_TCRArchive.pdf - why can't I figure this out?? Thanks in advance (FYI, I took over this code from another employee who is no longer here, and I don't 100% understand the code quite yet).

d = datetime.date.today()
if not d.month == 1:
dSubtracted = datetime.date(d.year,d.month-1,d.day)
else:
dSubtracted = datetime.date(d.year-1,12,d.day)

mxd = arcpy.mapping.MapDocument(r"C:\Mxds\TCRArchive.mxd")
outputpath = 'r"C:\Pdfs'
pdfarchivefilename = '{:%Y_%b_%d}_TCRArchive.pdf"'.format(dSubtracted)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 issue 正文中构建 pdfarchivefilename 的日期格式表达式入手,同时查看周围的日期和 PDF 导出代码。使用一个具有代表性的日期运行脚本,并验证生成的文件名使用大写的月份缩写,同时保留年份、日期和后缀。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
tooling
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。