simpler way to determine the source file location

This commit is contained in:
Axel Kohlmeyer
2015-06-29 23:12:20 -04:00
parent 7ecae004e4
commit d47d0de2b2

View File

@ -16,13 +16,12 @@
import sys,traceback,types
from ctypes import *
from os.path import dirname,abspath,join
from inspect import getsourcefile
class lammps:
def __init__(self,name="",cmdargs=None,ptr=None):
# determine module location
modpath = dirname(abspath(getsourcefile(lambda:0)))
modpath = dirname(abspath(__file__))
# load liblammps.so by default
# if name = "g++", load liblammps_g++.so