Unit Converter Web Application Version 6 | Learn Python From Scratch 24 | Kovolff

Veröffentlicht am: 06 Dezember 2020
auf dem Kanal: kovolff
98
0

In this video we enhanced our unit converter for it to be able to convert other types of units apart from length.

No new Python elements are introduced in this video. We just restructured our program. We modified the convertfunction convert_units and the index.py file.

A new field [genre] was added to the database table conversion_factors. The all new data was added to the database. For such scenarios Excel can be a very effective tool.

The function convert_units used to produce lists for the dropdowns. This is now deprecated as all dropdowns are created by index.py, as the latter has to do some pre-work before calling the function. Other than that, the function remains unchanged.

However index.py witnesses some bigger modifications. It has to call the database three times in order to generate the dropdowns: genre, from_unit and to_unit. All of this has to occur prior to calling the function.

Also the SELECT DISTINCT queries used to generate the dropdown had to be enhanced with a WHERE clause, as genre added a new dimension to the whole equation.

#python #web #programming


Auf dieser Seite können Sie das Online-Video Unit Converter Web Application Version 6 | Learn Python From Scratch 24 | Kovolff mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer kovolff 06 Dezember 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 98 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!