Hello Python developer,
Today, I will code Bitcoin price checker with requests module.
Python module is file set of python codes - functions.
I showed module declaration from the Python Glossary
(https://docs.python.org/3/glossary.html#term-module)
You can use codes in the Python module using 'import' keyword.
import Python module name
We will use 'requests' module for web-scrapping from the 'Binance' cryptocurrency exchange.
Here is the executed result.
'requests.get' code get the current Bitcoin price with USDT symbol from the Binance server.
There are two ways to print out the Bitcoin price.
- Print content variable from the current_price
- Using JSON module with json function to print out the current Bitcoin price
I also uploaded this code in my GibHub.
I hope you to enjoy above codes.
Have a nice day, Python developer!
No comments:
Post a Comment