Fw: Printing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim & Joanne Collins

    #1

    Fw: Printing



    Craig,

    Thank you very much for your response. I've interspersed my questions in
    your reply.

    If you have answers to my question I would be extremely gratefull for your
    assistance!

    Thanks.

    Jim Collins

    ----- Original Message -----[color=blue]
    > From: "Craig Ringer" <craig@postnews papers.com.au>
    > To: "Jim & Joanne Collins" <jjcollins@cabl eone.net>
    > Cc: <python-list@python.org >
    > Sent: Monday, December 20, 2004 11:34 PM
    > Subject: Re: Printing
    >
    >[color=green]
    > > On Tue, 2004-12-21 at 06:45, Jim & Joanne Collins wrote:
    > > I've completed a semester of computer programming in Python and one
    > > thing we didn't learn was how to send data to a windows printer
    > > instead of the screen.[/color]
    >
    > It would be helpful to know what graphical toolkit and canvas widget you
    > are using, as this may well be significant.[/color]

    I'm not using any widget or any graphics. I've done programs in Basic for
    years and they have all been strict data handling. I want to convert some
    to Python
    as Windows XP doesn't like 16 bit Basic.

    If I have a line in basic that says "print "This is a test print"" how do I
    direct that line to the printer
    instead of the console? And to send an escape sequence with it for printer
    control in PCL
    what is the syntax/format required?
    [color=blue][color=green]
    > > Any help would be greatly appreciated!
    > >
    > > My usual approach is actually to generate a PDF document using ReportLab
    > > and send that to the printer. Under *nix this is easy - if available,
    > > CUPS can handle PDF directly, or you use acroread -toPostScript to
    > > generate postscript and send that. Under Windows, I expect you can use
    > > COM to call acrobat if there isn't a simpler method.
    > >
    > > If you're using an existing canvas widget for your drawing, it depends
    > > on the canvas widget. Some can be saved to a bitmap, some can save
    > > vector data, etc.
    > >
    > > If you could explain how you're doing your screen drawing, that would
    > > help a lot.[/color][/color]

    No screen drawing - no graphics - just data and printer controls.
    [color=blue][color=green]
    > > Also, is there any way to send a shell command to access some function
    > > of the basic windows operating system such as sort?
    > >
    > > import os[/color][/color]

    How does one use the operating system after importing it? Syntax and
    commands?
    [color=blue][color=green]
    > > help(os.system)
    > > help(os.popen)
    > >
    > > for more advanced use, COM is an option.[/color][/color]

    What is the syntax for using COM?
    [color=blue][color=green][color=darkred]
    > > > Or to do a DOS directory and send it directly to a file to be accessed
    > > > as needed?[/color]
    > >
    > > I'm afraid I just don't understand that. "Do" a DOS directory? If you
    > > want to list the contents of a directory, see help(os.listdir ) .[/color][/color]

    In basic I write "shell"dir c:\temp\*.*>fil es.tem" and it does the same as
    a dir command
    at a DOS prompt and stores it in "files.tem" for me to access later.
    --[color=blue][color=green]
    > > Craig Ringer
    > >[/color]
    >[/color]

Working...