Machine-assisted translation of the Hebrew original, awaiting the lecturer's review.
Lab 2 — Tools and permissions
Running
python code/lab02/tools.py
What should come out
The three expected results:
- A price of 1200 is rejected, zero writes, the price stays 1500.
- A city outside the list is rejected, zero network calls.
- An allowed city in offline mode returns a visible error, not a forecast.
Try it yourself
Open-Meteo appears in the file as a separate function, off by default. To really call the service, run python code/lab02/tools.py --live from a computer with a network. The address is https://api.open-meteo.com, and use is subject to their terms.
Next
Found a mistake on this page? Email the lecturer