updated code to handle printing on windows

Benjamin Mako Hill || Want to submit a patch?