Page MenuHomec4science

pNbody_copy-examples
No OneTemporary

File Metadata

Created
Fri, Jan 31, 10:45

pNbody_copy-examples

#!/usr/bin/env python
from pNbody import *
import shutil
EXAMPLES=os.path.join(PNBODYPATH,'examples')
dest = os.path.join(HOME,"pnbody_examples")
# check if .pNbody exists
if os.path.isdir(dest):
answer = raw_input('WARNING : The directory %s alredy exists. Remove it [y/N] ? ' %(dest))
if answer == "y" or answer == "Y":
print "Removing %s"%dest
shutil.rmtree(dest)
else:
print "Nothing done."
sys.exit()
# recursive copy
print "copying files from %s"%EXAMPLES
print "to %s"%dest
shutil.copytree(EXAMPLES,dest)
print "done."
print
print "you can now move to %s and test the examples."%dest
print

Event Timeline