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
In questa pagina del sito puoi guardare il video online Unit Converter Web Application Version 6 | Learn Python From Scratch 24 | Kovolff della durata di ore minuti seconda in buona qualità , che l'utente ha caricato kovolff 06 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 98 volte e gli è piaciuto 0 spettatori. Buona visione!