Urwid Example Screenshots

Urwid Home Page / Example Screenshots / UTF-8 Screenshots / Tutorial / Reference

Try the [Live Demo] of the web_display module.


tour.py

Welcome to the urwid tour! 
UP / DOWN / PAGE UP / PAGE 
DOWN scroll.  F8 exits.    
                           
  Text widgets are the     
  most common in any       
  urwid program.  This     
  Text widget was created  
  without setting the      
  wrap or align mode, so   
  it defaults to left      
  alignment with wrapping  
  on space characters.     
  Change the window width  
  to see how the widgets   
  on this page react.      
  This Text widget is      
  wrapped with a Padding   
  widget to keep it        
  indented on the left     
  and right.               
                           
  This Text widget is right
    aligned.  Wrapped words
stay to the right as well. 
Welcome to the urwid tour!  UP / DOWN / PAGE UP / 
PAGE DOWN scroll.  F8 exits.                      
                                                  
  Text widgets are the most common in any urwid   
  program.  This Text widget was created without  
  setting the wrap or align mode, so it defaults  
  to left alignment with wrapping on space        
  characters.  Change the window width to see     
  how the widgets on this page react.  This Text  
  widget is wrapped with a Padding widget to      
  keep it indented on the left and right.         
                                                  
 This Text widget is right aligned.  Wrapped words
                       stay to the right as well. 
                                                  
            This one is center aligned.           
                                                  
Text widgets may be clipped instead of wrapped.   

Urwid tour.  Shows many of the standard widget types and features.


fib.py

                         1
                         1
                         2
                         3
                         5
                         8
                        13
                        21
                        34
                        55
                        89
                       144
Fibonacci Set Viewer      
UP, DOWN, PAGE UP and PAGE
DOWN move view  Q exits   
                7778742049
               12586269025
               20365011074
               32951280099
               53316291173
               86267571272
              139583862445
              225851433717
              365435296162
              591286729879
              956722026041
             1548008755920
Fibonacci Set Viewer      
UP, DOWN, PAGE UP and PAGE
DOWN move view  Q exits   
   26925748508234281076009
   43566776258854844738105
   70492524767089125814114
  114059301025943970552219
  184551825793033096366333
  298611126818977066918552
  483162952612010163284885
  781774079430987230203437
 1264937032042997393488322
 2046711111473984623691759
 3311648143516982017180081
 5358359254990966640871840
Fibonacci Set Viewer      
UP, DOWN, PAGE UP and PAGE
DOWN move view  Q exits   

Urwid example fibonacci sequence viewer / unbounded data demo

Features:
- custom list walker class for browsing infinite set
- custom wrap mode "numeric" for wrapping numbers to right and bottom


edit.py

                del self.lines[self.focus+1]                                    
                                                                                
                                                                                
class EditDisplay:                                                              
        palette = [                                                             
                ('body','default', 'default'),                                  
                ('foot','dark cyan', 'dark blue', 'bold'),                      
                ('key','light cyan', 'dark blue', 'underline'),                 
                ]                                                               
                                                                                
        footer_text = ('foot', [                                                
                "Text Editor    ",                                              
                ('key', "F5"), " save  ",                                       
                ('key', "F8"), " quit",                                         
                ])                                                              
                                                                                
        def __init__(self, name):                                               
                self.save_name = name                                           
                self.walker = LineWalker( name )                                
Text Editor    F5 save  F8 quit                                                 

Urwid example lazy text editor suitable for tabbed and format=flowed text

Features:
- custom list walker for lazily loading text file

Usage:
edit.py <filename>



browse.py

/usr/share/doc/python                  
      + python                         
        - faq                          
        - python-policy.html           
        changelog.Debian.gz            
        copyright                      
        FAQ.html                       
        python-policy.sgml.gz          
        python-policy.txt.gz           
        README.Debian                  
      - python2.1                      
      - python2.1-dev                  
      - python2.2                      
      - python2.2-dev                  
      - python2.4                      
Directory Browser    UP,DOWN,PAGE      
UP,PAGE DOWN  SPACE  +,-  LEFT  HOME   
END  Q                                 
/usr/share/doc/python                  
      + python                         
        + faq                          
          extending.html               
          general.html                 
          gui.html                     
          installed.html               
          library.html                 
          programming.html             
          windows.html                 
        - python-policy.html           
        changelog.Debian.gz            
        copyright                      
        FAQ.html                       
        python-policy.sgml.gz          
Directory Browser    UP,DOWN,PAGE      
UP,PAGE DOWN  SPACE  +,-  LEFT  HOME   
END  Q                                 

Urwid example lazy directory browser / tree view

Features:
- custom selectable widgets for files and directories
- custom message widgets to identify access errors and empty directories
- custom list walker for displaying widgets in a tree fashion
- outputs a quoted list of files and directories "selected" on exit


calc.py

     Help Column ?            Column A 
Column Calculator                12000 
                                  + 19 
Numbers: 0-9        -------------------
                                 12019 
Operators: +, -, *                 * 5 
and /               -------------------
                                 60095 
Editing: BACKSPACE                     
and DELETE                             
                                       
Movement: UP, DOWN,                    
[text continues..                      
press ? then                           
scroll]                                
    Help  Column A  Column B  Column C 
Column ?     12000        52      1988 
Column Ca     + 19      + 62           
lculator  ---------     + 72           
             12019  ---------          
Numbers:       * 5       186           
0-9       ---------                    
             60095                     
Operators    - (B)                     
: +, -, * ---------                    
[text con    59909                     
tinues..     + (C)                     
press ?   ---------                    
then         61897                     
scroll]                                

Urwid advanced example column calculator application

Features:
- multiple separate list boxes within columns
- custom edit widget for editing calculator cells
- custom parent widget for links to other columns
- custom list walker to show and hide cell results as required
- custom wrap and align modes for editing right-1 aligned numbers
- outputs commands that may be used to recreate expression on exit


dialog.py

                              
                              
     Tell me something        
     about yourself.          
                              
     I like traffic           
     lights,                  
                              
                              
                              
         < Exit   >           
                              
                              
                              
                                  
                                  
    Download extra modules        
                                  
    [X] errn      Errinator       
                  0.9b            
    [ ] frob      Frobnob 5       
    [ ] k9        Bug Hound       
                                  
                                  
    < OK     >   < Cancel >       
                                  
                                  
                                  
                                 
                                 
                                 
    Vent radioactive gas?        
                                 
                                 
                                 
                                 
                                 
    < Yes    >   < No     >      
                                 
                                 
                                 
                                 

Urwid example similar to dialog(1) program