Re: cups.Connection.printFile

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Antoon Pardon

    Re: cups.Connection.printFile

    On 2008-09-16, Graham Jenkins <graham@vpac.or gwrote:
    >
    I'm trying to print a file from within a Python program.
    >
    The quick-and-dirty solution is to use something like:
    >
    fd = os.popen("lp -d MyPrinter", "wb")
    fd.write(MyFile Contents)
    >
    But it seems to me that there should be a clean solution like:
    >
    import cups
    stat =
    cups.Connection .printFile("MyF ile","MyPrinter ","MyTitle","My Options")
    What about systems that don't use cups for printing?

    --
    Antoon Pardon
  • Mike Driscoll

    #2
    Re: cups.Connection .printFile

    On Sep 19, 9:01 am, Antoon Pardon <apar...@forel. vub.ac.bewrote:
    On 2008-09-16, Graham Jenkins <gra...@vpac.or gwrote:
    >
    >
    >
    I'm trying to print a file from within a Python program.
    >
    The quick-and-dirty solution is to use something like:
    >
    fd = os.popen("lp -d MyPrinter", "wb")
    fd.write(MyFile Contents)
    >
    But it seems to me that there should be a clean solution like:
    >
    import cups
    stat =
    cups.Connection .printFile("MyF ile","MyPrinter ","MyTitle","My Options")
    >
    What about systems that don't use cups for printing?
    >
    --
    Antoon Pardon
    For Windows, there's a few different ways to print. Tim Golden has a
    list on his website:



    Mike

    Comment

    • Antoon Pardon

      #3
      Re: cups.Connection .printFile

      On 2008-09-26, Mike Driscoll <kyosohma@gmail .comwrote:
      On Sep 19, 9:01 am, Antoon Pardon <apar...@forel. vub.ac.bewrote:
      >On 2008-09-16, Graham Jenkins <gra...@vpac.or gwrote:
      >>
      >>
      >>
      I'm trying to print a file from within a Python program.
      >>
      The quick-and-dirty solution is to use something like:
      >>
      fd = os.popen("lp -d MyPrinter", "wb")
      fd.write(MyFile Contents)
      >>
      But it seems to me that there should be a clean solution like:
      >>
      import cups
      stat =
      cups.Connection .printFile("MyF ile","MyPrinter ","MyTitle","My Options")
      >>
      >What about systems that don't use cups for printing?
      >>
      >--
      >Antoon Pardon
      >
      For Windows, there's a few different ways to print. Tim Golden has a
      list on his website:
      >
      http://timgolden.me.uk/python/win32_how_do_i/print.html
      I have a linux system that doesn't use cups for printing.
      So his "clean" solution won't work on my box. Unless
      of course his cups.Connection .printFile is just a wrapper
      around os.popen("lp -d MyPrinter", "wb") or something
      similar.

      --
      Antoon Pardon

      Comment

      • Tim Golden

        #4
        Re: cups.Connection .printFile

        Antoon Pardon wrote:
        On 2008-09-26, Mike Driscoll <kyosohma@gmail .comwrote:
        >On Sep 19, 9:01 am, Antoon Pardon <apar...@forel. vub.ac.bewrote:
        >>On 2008-09-16, Graham Jenkins <gra...@vpac.or gwrote:
        >>>
        >>>
        >>>
        >>>I'm trying to print a file from within a Python program.
        >>>The quick-and-dirty solution is to use something like:
        >>>fd = os.popen("lp -d MyPrinter", "wb")
        >>>fd.write(MyF ileContents)
        >>>But it seems to me that there should be a clean solution like:
        >>>import cups
        >>>stat =
        >>>cups.Connect ion.printFile(" MyFile","MyPrin ter","MyTitle", "MyOptions" )
        >>What about systems that don't use cups for printing?
        >>>
        >>--
        >>Antoon Pardon
        >For Windows, there's a few different ways to print. Tim Golden has a
        >list on his website:
        >>
        >http://timgolden.me.uk/python/win32_how_do_i/print.html
        >
        I have a linux system that doesn't use cups for printing.
        So his "clean" solution won't work on my box. Unless
        of course his cups.Connection .printFile is just a wrapper
        around os.popen("lp -d MyPrinter", "wb") or something
        similar.

        Well I certainly don't pretend to offer any solutions on
        my "Win32 How do I?" pages except for how to do things
        on Win32 ;) .

        TJG

        Comment

        Working...