original_docstring: Display a demonstration of the DocViewer widget.
docstring: Display a demonstration of the DocViewer widget.
docstring_tokens: Display a demonstration of the DocViewer widget .
code: def demo():
      """Display a demonstration of the DocViewer widget."""
  
      root = Tk()
      root.title("tkDocViewer")
  
      d = DocViewerDemo(root)
      d.pack(side="top", expand=1, fill="both")
  
      # If a PDF file was named on the command line, display it
      if len(sys.argv) >= 2:
          # First command line argument is the file path
          path = sys.argv[1]
  
          # Second command line argument (optional) is a list of pages
          if len(sys.argv) >= 3:
              pages = sys.argv[2]
          else:
              pages = None
  
          d.display_file(path, pages)
  
      else:
          # Browse for a file to display after the main loop has started
          root.after(500, d.browse)
  
      root.mainloop()
code_tokens: def demo ( ) : root = Tk ( ) root . title ( "tkDocViewer" ) d = DocViewerDemo ( root ) d . pack ( side = "top" , expand = 1 , fill = "both" ) if len ( sys . argv ) >= 2 : path = sys . argv [ 1 ] if len ( sys . argv ) >= 3 : pages = sys . argv [ 2 ] else : pages = None d . display_file ( path , pages ) else : root . after ( 500 , d . browse ) root . mainloop ( )
short_docstring: Display a demonstration of the DocViewer widget.
short_docstring_tokens: Display a demonstration of the DocViewer widget .
comment: """Display a demonstration of the DocViewer widget."""$SEP$# If a PDF file was named on the command line, display it$SEP$# First command line argument is the file path$SEP$# Second command line argument (optional) is a list of pages$SEP$# Browse for a file to display after the main loop has started