Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
profile Namespace Reference

Data Structures

class  Profile
 

Functions

def run
 
def help
 
def Stats
 

Variables

list __all__ = ["run","help","Profile"]
 
list filename = sys.argv[1]
 

Function Documentation

def profile.help ( )

Definition at line 80 of file profile.py.

80 
81 def help():
82  for dirname in sys.path:
83  fullname = os.path.join(dirname, 'profile.doc')
84  if os.path.exists(fullname):
85  sts = os.system('${PAGER-more} ' + fullname)
86  if sts: print '*** Pager exit status:', sts
87  break
88  else:
89  print 'Sorry, can\'t find the help file "profile.doc"',
90  print 'along the Python search path.'
91 
def profile.run (   statement,
  filename = None 
)
Run statement under profiler optionally saving results in filename

This function takes a single argument that can be passed to the
"exec" statement, and an optional file name.  In all cases this
routine attempts to "exec" its first argument and gather profiling
statistics from the execution. If no file name is present, then this
function automatically prints a simple profiling report, sorted by the
standard name string (file/line/function-name) that is presented in
each line.

Definition at line 58 of file profile.py.

58 
59 def run(statement, filename=None):
60  """Run statement under profiler optionally saving results in filename
61 
62  This function takes a single argument that can be passed to the
63  "exec" statement, and an optional file name. In all cases this
64  routine attempts to "exec" its first argument and gather profiling
65  statistics from the execution. If no file name is present, then this
66  function automatically prints a simple profiling report, sorted by the
67  standard name string (file/line/function-name) that is presented in
68  each line.
69  """
70  prof = Profile()
71  try:
72  prof = prof.run(statement)
73  except SystemExit:
74  pass
75  if filename is not None:
76  prof.dump_stats(filename)
77  else:
78  return prof.print_stats()
79 
# print help
def profile.Stats (   args)

Definition at line 539 of file profile.py.

540 def Stats(*args):
541  print 'Report generating functions are in the "pstats" module\a'
542 
543 
# When invoked as main program, invoke the profiler on a script

Variable Documentation

list __all__ = ["run","help","Profile"]

Definition at line 43 of file profile.py.

list filename = sys.argv[1]

Definition at line 549 of file profile.py.