[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    Re: Printing
From:       Florian Schulze <florian.proff.schulze () gmx ! net>
Date:       2003-01-03 17:51:43
[Download RAW message or body]

On Fri, 03 Jan 2003 03:30:36 GMT darrell <dgallion1@yahoo.com> wrote:

> import os, re, thread, time, sys
> 
> assoc=os.popen("assoc .pdf").read()
> #'.pdf=AcroExch.Document\012'
> assocA=re.findall("=(.*)\012",assoc)[0]
> ftype=os.popen("ftype %s"%assocA).read()
> #'AcroExch.Document="e:\\sw\\Adobe\\Acrobat 4.0\\Acrobat\\Acrobat.exe" 
> "%1"\012'
> ftypeA=re.findall('=(".*?")', ftype)[0]
> 
> def pdfPrint(fn):
>     cmd= ftypeA.replace("/","\\")+" /p /h " + fn.replace("/","\\")
>     print 'CMD:', cmd
>     os.system(cmd)
> 
> def pdfStart(fn):
>     cmd= ftypeA.replace("/","\\")+" " + fn.replace("/","\\")
>     print "CMD:", cmd
>     thread.start_new_thread (os.system, (cmd,))
> 
> 
> A windows hack
> --Darrell

A Windows2000/XP(/NT?) hack.
It doesn't work on Windows9x(/ME?).

But it's cool. I learn something new on this list every day. And not only
about Python.

Maybe it's possible to get this directly from the registry for both Win9x
and WinNT? This kind of thing should be the same for all Windows versions.

Florian





-- 
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic