Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F100521764
pNbody_copy-examples
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 31, 10:45
Size
636 B
Mime Type
text/x-python
Expires
Sun, Feb 2, 10:45 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23982699
Attached To
rPNBODY pNbody
pNbody_copy-examples
View Options
#!/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
Log In to Comment