Created
April 26, 2013 11:25
-
-
Save exaos/5466555 to your computer and use it in GitHub Desktop.
Get Geant4 packages from CERN.
从 CERN 网站下载 Geant4 安装包的 Python 脚本程序。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os, os.path | |
import yaml | |
baseurl = 'http://geant4.cern.ch/support/source/' | |
datadir = os.getcwd() + "/../Data/" | |
urls = yaml.load(open("urls.yaml")) | |
for k in urls: | |
if 'get' in urls[k] and not urls[k]['get']: | |
print("Ignoring " + k + " ...") | |
continue | |
print("Getting " + k + " ...") | |
base_tgz = baseurl + urls[k]['tar'][0] | |
os.system("wget -c " + base_tgz) | |
for d in urls[k]['data']: | |
dat_url = baseurl + d | |
out_url = datadir + d | |
os.system("wget -O %s -c %s"%(out_url, dat_url)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v_9.6.p01: | |
tar: | |
- geant4.9.6.p01.tar.gz | |
data: | |
- G4NDL.4.2.tar.gz | |
- G4NDL.4.2.TS.tar.gz | |
- G4EMLOW.6.32.tar.gz | |
- G4PhotonEvaporation.2.3.tar.gz | |
- G4RadioactiveDecay.3.6.tar.gz | |
- G4SAIDDATA.1.1.tar.gz | |
- G4NEUTRONXS.1.2.tar.gz | |
- G4PII.1.3.tar.gz | |
- RealSurface.1.0.tar.gz | |
v_9.5.p02: | |
get: yes | |
tar: | |
- geant4.9.5.p02.tar.gz | |
- lib4.9.5.p02/WIN32-VC100-7.zip | |
data: | |
- G4NDL.4.0.tar.gz | |
- G4EMLOW.6.23.tar.gz | |
- G4PhotonEvaporation.2.2.tar.gz | |
- G4RadioactiveDecay.3.4.tar.gz | |
- G4ABLA.3.0.tar.gz | |
- G4NEUTRONXS.1.1.tar.gz | |
- G4PII.1.3.tar.gz | |
- RealSurface.1.0.tar.gz | |
mt_v_9.5.p01: | |
get: no | |
tar: | |
- geant4_mt_proto.9.5.p01.tar.gz | |
data: | |
- G4NDL.4.0.tar.gz | |
- G4EMLOW.6.23.tar.gz | |
- G4PhotonEvaporation.2.2.tar.gz | |
- G4RadioactiveDecay.3.4.tar.gz | |
- G4ABLA.3.0.tar.gz | |
- G4NEUTRONXS.1.1.tar.gz | |
- G4PII.1.3.tar.gz | |
- RealSurface.1.0.tar.gz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment