Homework 4
The deadline is Sunday, the 6th of December, 23:59 (Estonian time).
Exercise 1. Traffic sign
Choose a traffic sign (examples: https://en.wikipedia.org/wiki/Traffic_sign). Write a program that uses tkinter and its widget canvas to draw the traffic sign in the window with a white background. The title of the window has to be "Traffic Sign".
Exercise 2. Username from url
At the University of Tartu, every user of the Study Information System (a student or a member of staff) has his/her home directory. The user can create a webpage on the university server. The url for his/her webpage would be http://www.ut.ee/~username/ (e.g. http://www.ut.ee/~vilo/).
Write a program that prompts the user for a file name. The program has to read the file line by line, look for the user names (using regular expressions) and print the names out.
If the file urls.txt contains the following lines:
http://www.ut.ee/~koit/KT/index_eng.html Lecture lasts ~90 minutes http://www.ut.ee/~vilo/ http://www.ut.ee/~kiho/ "x ~ y" means that x and y are of the same order of magnitude
then the output of the program has to be
Please enter a file name: urls.txt The user names are: koit vilo kiho
Go to Moodle and upload your solution into Homework 4.