Skip to content

Instantly share code, notes, and snippets.

@jaidhyani
Last active June 7, 2017 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jaidhyani/f4b39a6a8ffc68622b9afa6e953a0730 to your computer and use it in GitHub Desktop.
Save jaidhyani/f4b39a6a8ffc68622b9afa6e953a0730 to your computer and use it in GitHub Desktop.
Watch the price of ETH from the terminal/tmux status bar
#!/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