-
Notifications
You must be signed in to change notification settings - Fork 0
/
pythonrc
36 lines (26 loc) · 849 Bytes
/
pythonrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Python startup config file
import atexit, os, sys
import rlcompleter, readline
# Not sure this is a good idea
from math import *
# Import NumPy
import numpy as np
from numpy.linalg import norm
# Load Atomic Simulation Environment
import ase
from ase import Atom, Atoms
from ase.io import read as ase_read
from ase.build import sort as ase_sort
import matplotlib.pyplot as plt
# Add local bin to the path
#sys.path.append(os.getenv("HOME")+"/bin/")
# Already defined in .bashrc $PYTHONPATH
# And this script is not loaded from .py script
readline.parse_and_bind('tab:complete')
# Set up history
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(historyPath=historyPath):
readline.write_history_file(historyPath)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
atexit.register(save_history)