Skip to main content
Machine-assisted translation of the Hebrew original, awaiting the lecturer's review.

Lab 2 — Tools and permissions

1 min read

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

Accessibility settings

These settings change how this site looks on this device only. They are saved in this browser.

Text

Colour

Light and dark mode are in the top bar, next to search.

Reading and navigation