« It Only Hurts When I Print | Main | Linear Layout for the Visualization of Networks by Martin Krzywinski »
Tuesday
Oct192010

IronPython Script to Draw a Simple Calendar in Visio

This week I needed to quickly print out a calendar and although I could have used Visio’s built-in calendar shapes (which would have been both easier and produce better results)  I instead decided to use this as an opportunity to show a real-world example of python’s calendar module in use.

The output is simple: just a grid as shown below. Days that fall out of the target month are shown with muted text.

image

 

SOURCE CODE

You can download the .PY file called drawcalendarmonth.py in my Collection of IronPython scripts for Visio

 

IN COMPARISON TO THE BUILT-IN SHAPES

Again, Visio’s built in Calendar shapes provides much more useful output.

 

image

 

When you drag the Month shape into a drawing, you’ll get control over several aspects of what to show. As you can see below, it even lets you control the language to use.

image

PrintView Printer Friendly Version

EmailEmail Article to Friend

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>