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

List:       python-list
Subject:    Re: Printing
From:       darrell <dgallion1 () yahoo ! com>
Date:       2003-01-03 3:30:36
[Download RAW message or body]

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
-- 
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