Last active
June 7, 2017 22:20
-
-
Save jaidhyani/f4b39a6a8ffc68622b9afa6e953a0730 to your computer and use it in GitHub Desktop.
Watch the price of ETH from the terminal/tmux status bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.5 | |
import requests | |
import locale | |
locale.setlocale(locale.LC_ALL, '') | |
price = requests.get( | |
'https://coinmarketcap-nexuist.rhcloud.com/api/eth' | |
).json()['price']['usd'] | |
currency = lambda d: locale.currency(d, grouping=True) | |
print(currency(price)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment