This file contains 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
$python parallel.py | |
[13:48:59:130701] Doing GET request to http://google.com | |
[13:48:59:134958] Doing GET request to http://facebook.com | |
[13:48:59:135498] Doing GET request to http://twitter.com | |
[13:48:59:136174] Doing GET request to http://slack.com | |
****** STATUSES: [{'status': 200, 'url': 'http://google.com'}, {'status': 200, 'url': 'http://twitter.com'}, {'status': 200, 'url': 'http://slack.com'}, {'status': 200, 'url': 'http://facebook.com'}] | |
$python sequential.py | |
[13:49:04:078752] Doing GET request to http://google.com | |
[13:49:04:232725] Doing GET request to http://facebook.com |
This file contains 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
import hashlib as hasher | |
import datetime as date | |
# Define what a Snakecoin block is | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash |