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 urllib.request | |
with urllib.request.urlopen('http://python.org/') as response: | |
html = response.read() | |
with open("stored.html", "r+") as file: | |
if not (str(file.read()) == str(html)): | |
print("THIS IS WHERE YOU ALERT") | |
file.seek(0) #sets file pointer to beginning | |
file.truncate() #empties the file | |
file.write(str(html)) |
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
// basic performance test of let and var in node v5.2.0 | |
"use strict" | |
var n = Date.now(); | |
var count = 0; | |
for(var i = 0; i < 10000000000; i++){ | |
count += i; | |
} | |
console.log(Date.now() - n); | |
//run 1:35443 |