CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
interactivePythonTest Namespace Reference

Functions

def interactive_inspect_mode
 
def save_history
 

Variables

tuple historyPath = os.path.expanduser("~/.pyhistory")
 Load and save command line history when ## running interactively. More...
 

Function Documentation

def interactivePythonTest.interactive_inspect_mode ( )

Definition at line 10 of file interactivePythonTest.py.

Referenced by save_history().

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

Definition at line 26 of file interactivePythonTest.py.

References interactive_inspect_mode(), and print().

26 
27  def save_history(historyPath=historyPath):
28  import readline
29  readline.write_history_file(historyPath)
30  if os.path.exists(historyPath):
31  readline.read_history_file(historyPath)
32 

Variable Documentation

tuple interactivePythonTest.historyPath = os.path.expanduser("~/.pyhistory")

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

Definition at line 23 of file interactivePythonTest.py.