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
| from mnemonic import Mnemonic | |
| from pycoin.symbols.btc import network | |
| from pycoin.symbols.xtn import network as testnetwork | |
| # Parameters | |
| language = 'english' | |
| length = 24 # Can also be 24 | |
| passphrase = "" # Can leave blank | |
| mainnet = True |
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 | |
| """Convert a markdown file to html.""" | |
| import os | |
| import sys | |
| import mistune # pip install mistune | |
| # Usage: python convert.py [filename] | |
| if __name__ == "__main__": | |
| markdown_text = "" | |
| if os.path.isfile(sys.argv[1]): |
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
| """ | |
| Get Bitcoin price from CoinMarketCap API using python requests | |
| """ | |
| import requests | |
| if __name__ == "__main__": | |
| url = "https://api.coinmarketcap.com/v1/ticker/bitcoin/" | |
| response = requests.get(url) | |
| print " ID: {}".format(response.json()[0]["id"]) | |
| print "Price: {}".format(response.json()[0]["price_usd"]) |
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
| """ | |
| Move a character around a curses window | |
| """ | |
| import curses | |
| from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN | |
| if __name__ == "__main__": | |
| # Draw the curses window | |
| curses.initscr() |