Skip to content

Instantly share code, notes, and snippets.

View chrrrisw's full-sized avatar

Chris Willoughby chrrrisw

View GitHub Profile
@chrrrisw
chrrrisw / README.rst
Last active April 10, 2017 04:25
numpy and scipy treat bytes and bytearrays differently

Open a python interpreter and import numpy:

>>> import numpy as np

Now create a bytes object and create a numpy array from it:

>>> my_bytes = bytes([0, 1, 127, 255])
>>> my_np_bytes = np.array(my_bytes)
>>> my_np_bytes.size
1
@chrrrisw
chrrrisw / Makefile
Last active April 3, 2016 21:47
Getting short filenames (8.3 format) from a FAT partition on Linux in Python
all: generate_ioctl vfat_ioctl.py
generate_ioctl: generate_ioctl.c
vfat_ioctl.py: generate_ioctl
./generate_ioctl > vfat_ioctl.py