from bs4 import BeautifulSoup
def read_excel_xml(path):
file = open(path).read()
soup = BeautifulSoup(file,'xml')
workbook = []
for sheet in soup.findAll('Worksheet'):
sheet_as_list = []
for row in sheet.findAll('Row'):
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 os.path | |
from functools import wraps | |
from flask import Flask, request, Response, redirect | |
from flask_autoindex import AutoIndex | |
fileroot = os.path.join(os.path.realpath(os.path.curdir), 'files') | |
app = Flask(__name__) | |
idx = AutoIndex(app, | |
browse_root=fileroot, | |
add_url_rules=False) |
This is a quick Python script I wrote to download HumbleBundle books in batch. I bought the amazing Machine Learning by O'Reilly bundle. There were 15 books to download, with 3 different file formats per book. So I scratched a quick script to download all of them in batch.
(Final Result: books downloaded)
This article is now published on my website: When are circular imports fatal?
By default, PyTorch team doesn't release packages for ARM architecture. Luckily, someone is supplying unofficial builds (hats off to this person!).
Fast.ai also has a problem: it depends on spaCy, which also doesn't want to build on ARM by default. I'm not going to do NLP, so will install fast.ai without spaCy.
I initially tried using ARM builds from here:
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
"Dynamic plotting in matplotlib. Copy and paste into a Jupyter notebook." | |
# written October 2016 by Sam Greydanus | |
%matplotlib notebook | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import time | |
def plt_dynamic(x, y, ax, colors=['b']): | |
for color in colors: | |
ax.plot(x, y, color) |
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
#!/usr/bin/env lua5.1 | |
-- assocation list on the command line | |
-- | |
-- rep is: key1 val1 key2 val2 ... | |
-- | |
local function succeed(s) | |
if s ~= true then | |
io.stdout:write(s, '\n') |
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
//***************************************** | |
// NEC (Japanese) Infrared code sending library for the Arduino | |
// Send a standard NEC 4 byte protocol direct to an IR LED on the define pin | |
// Assumes an IR LED connected on I/O pin to ground, or equivalent driver. | |
// Tested on a Freetronics Eleven Uno compatible | |
// Written by David L. Jones www.eevblog.com | |
// Youtube video explaining this code: http://www.youtube.com/watch?v=BUvFGTxZBG8 | |
// License: Creative Commons CC BY | |
//***************************************** |
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
#!/usr/bin/env python3 | |
"""Easily put time restrictions on things | |
Note: Requires Python 3.x | |
Usage as a context manager: | |
``` | |
with timeout(10): | |
something_that_should_not_exceed_ten_seconds() | |
``` |
OlderNewer