Skip to content

Instantly share code, notes, and snippets.

View bfroehle's full-sized avatar

Bradley M. Froehle bfroehle

View GitHub Profile
#!/usr/bin/env python
import re
import requests
html = requests.get('')
all_pages_table ='<table class="mw-allpages-table-chunk">(.*)</table>',
html.content, re.DOTALL).group()
titles = re.findall(r'title="([^"]*?)"', all_pages_table)
bfroehle / 00README.rst
Created June 13, 2012 16:01 — forked from GaelVaroquaux/00README.rst
Copy-less bindings of C-generated arrays with Cython

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy