In this article, we are going to discuss how to get Gold and Silver Price in India Using Python in Tkinter. There is a variation in price with time to time, price of gold and silver is moved by a combination of supply, demand, and investor behavior.
We will use goodreturns website for fetching gold and silver price. We will create multiple functions for different operation:
- silver_price(): This function is used for getting the silver price. For silver, we will use this URL.
- gold_price(): This function is used for getting the gold price. For Gold, we will use this URL.
- get_number_from_string(): This function is used to extract integer or float from string.
- change_price(): This function is used to get the gold or silver price of a particular weight.
Import Required Libraries.
Get Silver and Gold Price.
Get Integer or float value from the string.
Get the price of gold and silver for a particular weight.
Below is the implementation based on the above approach:
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course