Re: Redirect Graphical output

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Genellina

    Re: Redirect Graphical output

    En Sat, 15 Nov 2008 07:27:47 -0200, Indian <write2abdul@gm ail.com>
    escribió:
    Is there any way we can redirect graphical output to some file
    What i require is to run a test for my function but it involves dialog
    boxes
    but a test shld be run without user intervention :(
    >
    >
    import sys
    import dialog
    import wx
    app = wx.PySimpleApp( )
    sys.stdout = open('c:\\abc.t xt','w')
    dialog.ConfirmM essageBox('hell o','abdul',wx.O K)
    sys.stdout=sys. __stdout__
    >
    I was trying to use the above code but noticed it was tough to redirect
    to a
    file
    Please help :)
    (I don't get what the above code is supposed to perform)
    You're right, unit tests should run without user intervention. So in
    principle, the function being tested should not call a dialog box
    directly. There are several strategies to deal with that, as a general
    rule, try to separate the user interfase from the "processing " code.

    --
    Gabriel Genellina

Working...