PY shutil on win xp home version

jim-on-linux inq1ltd at verizon.net
Fri Apr 20 02:04:22 CEST 2007


On Wednesday 18 April 2007 17:02, Tim Golden 
wrote:
> jim-on-linux wrote:
> > python help,
> >
> > A client is using win xp home.
> >
> >  my program contains;
> >    shutil.copyfile(n, 'prn')
> >
> > This runs fine on win xp pro but they are
> > getting the following traceback.
> >
> >  File "LOP_PRT_10.pyc", line 170, in __init__
> >   File "LOP_PRT_10.pyc", line 188, in Fprint1
> >   File "shutil.pyc", line 47, in copyfile
> > IOError: [Errno 2] No such file or directory:
> > 'prn'
> >
> > Since this runs ok on win xp pro, does this
> > have something to do with the home version of
> > xp.
> >
> > I'm thinking of changeing  'prn' to 'lpt1'
> > and trying again but I don't want to  use the
> > client as a testor.  Or is there some other
> > explaination for the problem.
>
> Not that this is your question, but if you're
> trying to print under Windows have you looked
> at:
>
>   
> http://tgolden.sc.sabren.com/python/win32_how_d
>o_i/print.html
>
> for alternatives?
>
> TJG

Thanks for the response,

I got the following to work on windows.

win32api.ShellExecute (
                    0, 'print', 
                    filename, None, ".", 0
                    )

However it prints the name of the file at the top 
and adds a page number on the bottom.  Is there 
some way of eliminating the filename and page 
number.


jim-on-linux























More information about the Python-list mailing list