Most of my work with python uses almost the same modules as well as default settings so I want to do this once for all. This is what I did: 1. put export PYTHONSTARTUP=$HOME/.pythonrc into ~/.bashrc file 2. put the following code into the /.pythonrc file
from pylab import *
import os
rc('font', **{'family': 'serif', 'serif': ['Computer Modern']})
rc('text', usetex=True)
However, when I run the following code python3 test.py with the test.py containing the simple code like this:
os.chdir('/Users/username/Documents/python/test/')
datadax=loadtxt('py_dax.txt')
datashaxn=loadtxt('py_shaxn.txt')
datashaxw=loadtxt('py_shaxw.txt')
It gives me the error: NameError: name 'os' is not defined
I am not sure which step I did wrong.