Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F112212520
gcmd
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
Thu, May 8, 23:25
Size
1 KB
Mime Type
text/x-python
Expires
Sat, May 10, 23:25 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26043330
Attached To
rPNBODY pNbody
gcmd
View Options
#!/usr/bin/env python
import os,thread,sys,string,time,glob
from Tkinter import *
from tkMessageBox import askokcancel
from tkMessageBox import showerror
from tkFileDialog import asksaveasfilename
from tkFileDialog import askopenfilename
from numpy import *
from pNbody import *
from pNbody import param
from pNbody import io
from pNbody import geometry as geo
import Ptools as pt
try:
from optparse import OptionParser
except ImportError:
from optik import OptionParser
########################################
#
# parser
#
########################################
def parse_options():
usage = "usage: %prog [options] file"
parser = OptionParser(usage=usage)
parser = pt.add_units_options(parser)
parser = pt.add_ftype_options(parser)
parser.add_option("--exec",
action="store",
dest="execline",
type="string",
default = None,
help="give command to execute before",
metavar=" STRING")
(options, args) = parser.parse_args()
if len(args) == 0:
print "you must specify a filename"
sys.exit(0)
files = args
return files,options
################################################################################
#
# MAIN
#
################################################################################
files,options = parse_options()
execline = options.execline
for file in files:
nb = Nbody(file,ftype=options.ftype)
if execline != None:
exec(execline)
Event Timeline
Log In to Comment