From ebf3ff67b6eb33e277ba233a48b053f4d27b9fd9 Mon Sep 17 00:00:00 2001 From: Kasper Souren Date: Wed, 30 Jul 2014 00:16:55 +0200 Subject: [PATCH] #51 IPython integration: now retaining sys.argv --- erppeek.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/erppeek.py b/erppeek.py index 77144a8..8f59466 100755 --- a/erppeek.py +++ b/erppeek.py @@ -1608,8 +1608,14 @@ def main(): if client.connect is not None: if not client.user: client.connect() - # Enter interactive mode - _interact(global_vars) + try: + # First try IPython + import IPython + return IPython.start_ipython(user_ns=global_vars, argv=[]) + except ImportError: + # Enter interactive mode + _interact(global_vars) + if __name__ == '__main__': main()