Wednesday, 9 May 2012

Python Adventures Part 1

Add path using shell variable PYTHONPATH
then load module of your file (i.e. survey.py)

Must reload this everytime a change is made using reload(survey). Ugh.
To fix this, go to ipython and 
import ipy_autoreload. 
Then run 
%autoreload 2

 (other behaviours given by %autoreload ?)

To read csv, import numpy and then use function recfromscv

to get help with functions, import the module and type help(module.function)

To automatically make all things in a module accessible just do 
from module import *


No comments:

Post a Comment