CMS 3D CMS Logo

Functions
interactivePythonTest Namespace Reference

Functions

def interactive_inspect_mode ()
 
def save_history (historyPath=historyPath)
 Load and save command line history when ## running interactively. More...
 

Function Documentation

def interactivePythonTest.interactive_inspect_mode ( )

Definition at line 9 of file interactivePythonTest.py.

Referenced by save_history().

10  # http://stackoverflow.com/questions/640389/tell-whether-python-is-in-i-mode
11  flagPtr = ctypes.cast(ctypes.pythonapi.Py_InteractiveFlag,
12  ctypes.POINTER(ctypes.c_int))
13  return flagPtr.contents.value > 0 or bool(os.environ.get("PYTHONINSPECT",False))
14 
15 
def interactivePythonTest.save_history (   historyPath = historyPath)

Load and save command line history when ## running interactively.

Definition at line 25 of file interactivePythonTest.py.

References interactive_inspect_mode().

25  def save_history(historyPath=historyPath):
26  import readline
27  readline.write_history_file(historyPath)
28  if os.path.exists(historyPath):
29  readline.read_history_file(historyPath)
30 
31 
def save_history(historyPath=historyPath)
Load and save command line history when ## running interactively.