Page MenuHomec4science

gpy
No OneTemporary

File Metadata

Created
Thu, Oct 31, 16:17
#!/usr/bin/env python -i
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
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.add_option("-t",
action="store",
dest="ftype",
type="string",
default = None,
help="type of the file",
metavar=" TYPE")
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)
file = None
else:
file = args
return file,options
################################################################################
#
# MAIN
#
################################################################################
file,options = parse_options()
execline = options.execline
nb = Nbody(file,ftype=options.ftype)
if execline != None:
exec(execline)

Event Timeline