Python programming exercises
Understand how to create Python classes and explore when to use them.
Understand the @property decorator.
Use PyTest framework to test objects.
Explore the design and testing of GUIs.
Copy this repository to a suitable working directory - it's often easier to work on your C: drive.
Install PyTest using Pip. You might want to create a Python virtual env first.
pip install pytest
-
Run the tests provided using the
pytest
command. -
Replace print statements with logging calls.
-
Consider the failing test. Can you fix the code.
-
Try changing name from John to Johnny. What happens?
-
Write a similar test for the age parameter, one that checks for negative values.
-
What happens if you give a floating point age? e.g. 12.5
-
How might the code be further improved?
-
Run the program. You might need to install TkInter
-
Use the keys and observe the output.
-
Can you create a working calculator?
-
How can unit tests be used?
The file speech/record.py
should help with the assignment. It needs tidying up, and might not be complete.