| 两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
|
python-files:pdf-calendar [2017/04/01 06:03] admin [Python 源代码] |
python-files:pdf-calendar [2017/04/01 06:08] (当前版本) admin |
||
|---|---|---|---|
| 行 5: | 行 5: | ||
| * calendar (python self contained) | * calendar (python self contained) | ||
| * reportlab | * reportlab | ||
| + | |||
| + | ===== 功能修改 ===== | ||
| + | 做了下面的一些修改。 | ||
| + | |||
| + | ==== 字体 ==== | ||
| 在源代码里面增加了字体部分: | 在源代码里面增加了字体部分: | ||
| - | <code> | + | <code python> |
| - | canvas.setFont("Times-Roman", 20) | + | canvas.setFont("Times-Roman", 20) |
| </code> | </code> | ||
| - | ===== Python 源代码 ===== | + | ==== 增加日历的星期名称 ==== |
| <code python> | <code python> | ||
| - | #!/usr/bin/env python | + | weekheader = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ]; |
| - | """Create a PDF calendar. | + | </code> |
| - | This script requires Python and Reportlab | + | 日历表格中行数增加一行,表格的线也都补齐了。 |
| - | ( http://reportlab.org/rl_toolkit.html ). Tested only with Python 2.4 and | + | |
| - | Reportlab 1.2. | + | |
| - | See bottom of file for an example of usage. No command-line interface has been | + | 生成的日历PDF文件为: {{ :python-files:python-generate-printable-calendar.pdf |}} |
| - | added, but it would be trivial to do so. Furthermore, this script is pretty | + | |
| - | hacky, and could use some refactoring, but it works for what it's intended | + | |
| - | to do. | + | |
| - | Created by Bill Mill on 11/16/05, this script is in the public domain. There | + | ===== Python 源代码 ===== |
| - | are no express warranties, so if you mess stuff up with this script, it's not | + | |
| - | my fault. | + | |
| + | |||
| + | <code python> | ||
| - | If you have questions or comments or bugfixes or flames, please drop me a line | ||
| - | at bill.mill@gmail.com . | ||
| - | """ | ||
| from reportlab.lib import pagesizes | from reportlab.lib import pagesizes | ||
| from reportlab.pdfgen.canvas import Canvas | from reportlab.pdfgen.canvas import Canvas | ||