git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8649 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
25
python/install.py
Normal file
25
python/install.py
Normal file
@ -0,0 +1,25 @@
|
||||
#!/usr/local/bin/python
|
||||
|
||||
# copy lammps.py and LAMMPS shared library src/liblmp.so to
|
||||
# Python site-packages dir
|
||||
|
||||
import sys,commands
|
||||
|
||||
# find this Python's site-packages dir in sys.path list
|
||||
|
||||
paths = sys.path
|
||||
for i,path in enumerate(paths):
|
||||
index = path.rfind("site-packages")
|
||||
if index < 0: continue
|
||||
if index == len(path) - len("site-packages"): break
|
||||
sitedir = paths[i]
|
||||
|
||||
str = "cp ../python/lammps.py %s" % sitedir
|
||||
print str
|
||||
outstr = commands.getoutput(str)
|
||||
if len(outstr.strip()): print outstr
|
||||
|
||||
str = "cp ../src/liblmp.so %s" % sitedir
|
||||
print str
|
||||
outstr = commands.getoutput(str)
|
||||
if len(outstr.strip()): print outstr
|
||||
Reference in New Issue
Block a user