LAM Image Annotator Homework

From PkalTides Wiki
Jump to: navigation, search

--Thiebaut (talk) 17:13, 27 July 2015 (EDT)



Back to Liberal Arts Modules page

Problem #1


Write a TKInter program that provides the following features:

  • It contains 3 buttons, a label, and a text area.
  • It opens up with a blank text area, and a label that contains a '-' (dash) character


TkHomework1a.png


  • When the user clicks on the File Open button, a dialog opens up and allows the user to specify a text file to open.
  • If the file is valid, its contents is shown in the text area of the Tk window. The image below shows the text of a Smith College Web page taken from this URL: http://www.smith.edu/global_contactsmith.php


TkHomework1b.png


  • When the user presses the Process button, the program scans the text and extracts all the email addresses, and replaces the contents of the text area with the list of sorted email addreses, with duplicates removed.
TkHomework1c.png



Problem #2



Write a TKInter program based on the program for Problem 1, above. This second program should provides the following features:

  • It contains 3 buttons, a label, and two text areas, side by side. They are both 40 characters wide, and 30 lines high.
  • It opens up with both text areas blank, and a label that contains a '-' (dash) character
  • The clear button erases both text areas.


TkHomework2a.png


  • When the user clicks on the File Open button, a dialog opens up and allows the user to specify a text file to open.
  • If the file is valid, its contents is shown in the left text area of the Tk window. The image below shows the text of a Smith College Web page taken from this URL: http://www.smith.edu/global_contactsmith.php


TkHomework2b.png


  • When the user presses the Process button, the program scans the text in the left text-area, and extracts all the email addresses, and replaces the contents of the text area on the right with the list of sorted email addreses, with duplicates removed.



TkHomework2c.png