Python Tutorial

To print the current working directory:

import os
print „The current working directory is“, os.getcwd()

To Load an Image:

from PIL import Image

# open random image of dimensions 639×516
path=r’C:\Users\Lukas\Theano\wolfmoon.jpg‘
img = Image.open(path)
# dimensions are (height, width, channel)
img = numpy.asarray(img, dtype=’float64′) / 256.