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))
16 if __name__ ==
'__main__':
22 historyPath = os.path.expanduser(
"~/.pyhistory")
27 readline.write_history_file(historyPath)
28 if os.path.exists(historyPath):
29 readline.read_history_file(historyPath)
32 atexit.register(save_history)
33 readline.parse_and_bind(
"set show-all-if-ambiguous on")
34 readline.parse_and_bind(
"tab: complete")
35 if os.path.exists (historyPath) :
36 readline.read_history_file(historyPath)
37 readline.set_history_length(-1)
40 print "python -i `which interactivePythonTest.py` " def interactive_inspect_mode()
def save_history(historyPath=historyPath)
Load and save command line history when ## running interactively.