parameters: (port=0, *, open_browser=True, hostname='localhost')
docstring: Start the enhanced pydoc Web server and open a Web browser.
  
      Use port '0' to start the server on an arbitrary port.
      Set open_browser to False to suppress opening a browser.
docstring_summary: Start the enhanced pydoc Web server and open a Web browser.
docstring_tokens: Start the enhanced pydoc Web server and open a Web browser .
function: def browse(port=0, *, open_browser=True, hostname='localhost'):
      """Start the enhanced pydoc Web server and open a Web browser.
  
      Use port '0' to start the server on an arbitrary port.
      Set open_browser to False to suppress opening a browser.
      """
      import webbrowser
      serverthread = _start_server(_url_handler, hostname, port)
      if serverthread.error:
          print(serverthread.error)
          return
      if serverthread.serving:
          server_help_msg = 'Server commands: [b]rowser, [q]uit'
          if open_browser:
              webbrowser.open(serverthread.url)
          try:
              print('Server ready at', serverthread.url)
              print(server_help_msg)
              while serverthread.serving:
                  cmd = input('server> ')
                  cmd = cmd.lower()
                  if cmd == 'q':
                      break
                  elif cmd == 'b':
                      webbrowser.open(serverthread.url)
                  else:
                      print(server_help_msg)
          except (KeyboardInterrupt, EOFError):
              print()
          finally:
              if serverthread.serving:
                  serverthread.stop()
                  print('Server stopped')
function_tokens: def browse ( port = 0 , * , open_browser = True , hostname = 'localhost' ) : import webbrowser serverthread = _start_server ( _url_handler , hostname , port ) if serverthread . error : print ( serverthread . error ) return if serverthread . serving : server_help_msg = 'Server commands: [b]rowser, [q]uit' if open_browser : webbrowser . open ( serverthread . url ) try : print ( 'Server ready at' , serverthread . url ) print ( server_help_msg ) while serverthread . serving : cmd = input ( 'server> ' ) cmd = cmd . lower ( ) if cmd == 'q' : break elif cmd == 'b' : webbrowser . open ( serverthread . url ) else : print ( server_help_msg ) except ( KeyboardInterrupt , EOFError ) : print ( ) finally : if serverthread . serving : serverthread . stop ( ) print ( 'Server stopped' )