<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def browse(self, wait=True, tempname="/tmp/seltable"):
 """ Browse a table using casabrowser or a simple wxwidget based browser. By default the casabrowser is used if it can be found (in your PATH). Otherwise the wxwidget one is used if wx can be loaded. The casabrowser can only browse tables that are persistent on disk. This gives problems for tables resulting from a query because they are held in memory only (unless an output table name was given). To make browsing of such tables possible, the argument `tempname` can be used to specify a table name that will be used to form a persistent table that can be browsed. Note that such a table is very small as it does not contain data, but only references to rows in the original table. The default for `tempname` is '/tmp/seltable'. If needed, the table can be deleted using the :func:`tabledelete` function. If `wait=False`, the casabrowser is started in the background. In that case the user should delete a possibly created copy of a temporary table. """

        import os
        # Test if casabrowser can be found.
        # On OS-X 'which' always returns 0, so use test on top of it.
        # Nothing is written on stdout if not found.
        if os.system('test `which casabrowser`x != x') == 0:
            waitstr1 = ""
            waitstr2 = "foreground ..."
            if not wait:
                waitstr1 = " &"
                waitstr2 = "background ..."
            if self.iswritable():
                six.print_("Flushing data and starting casabrowser in the " +
                           waitstr2)
            else:
                six.print_("Starting casabrowser in the " + waitstr2)
            self.flush()
            self.unlock()
            if os.system('test -e ' + self.name() + '/table.dat') == 0:
                os.system('casabrowser ' + self.name() + waitstr1)
            elif len(tempname) > 0:
                six.print_("  making a persistent copy in table " + tempname)
                self.copy(tempname)
                os.system('casabrowser ' + tempname + waitstr1)
                if wait:
                    from casacore.tables import tabledelete
                    six.print_("  finished browsing")
                    tabledelete(tempname)

                else:
                    six.print_(" after browsing use tabledelete('" + tempname +
                               "') to delete the copy")
            else:
                six.print_("Cannot browse because the table is in memory only")
                six.print_("You can browse a (shallow) persistent copy " +
                           "of the table like: ")
                six.print_("   t.browse(True, '/tmp/tab1')")
        else:
            try:
                import wxPython
            except ImportError:
                six.print_('casabrowser nor wxPython can be found')
                return
            from wxPython.wx import wxPySimpleApp
            import sys
            app = wxPySimpleApp()
            from wxtablebrowser import CasaTestFrame
            frame = CasaTestFrame(None, sys.stdout, self)
            frame.Show(True)
            app.MainLoop()