if __name__ ='__main__'root tk(if len(sys argv st scrolledtext(file=sys argv[ ]elsest scrolledtext(text='words\ngo here'def show(event)print(repr(st gettext())root bind(''showroot mainloop(first through last filename on cmdline or nottwo lines show as raw string esc dump text like the scrolledlist in example - the scrolledtext object in this file is designed to be reusable component which we'll also put to work in later examplesbut it can also be run standalone to display text file contents also like the last sectionthis script is careful to pack the scroll bar first so that it is cut out of the display last as the window shrinks and arranges for the embedded text object to expand in both directions as the window grows when run with filename argumentthis script makes the window shown in figure - it embeds text widget on the left and cross-linked scroll bar on the right figure - scrolledtext in action just for funi populated the text file displayed in the window with the following code and command lines (and not just because used to live near an infamous hotel in colorado) :\pp \gui\tourtype makefile py open('jack txt'' 'text