1

I'm trying to embed an ipython console into my command line application. I have the following:

import IPython
from traitlets.config import Config
c = Config()
c.InteractiveShellApp.exec_lines = [
    'import matplotlib.pyplot as plt',
    '%matplotlib',
]
return IPython.start_ipython(config=c, user_ns=globals())

However, it seems to completely ignore the "exec_lines" part since plt is not available.

Lucidnonsense
  • 1,195
  • 3
  • 13
  • 35

1 Answers1

1

See: Can you specify a command to run after you embed into IPython?

IPython.start_ipython(config=c, user_ns=locals()) 
abb
  • 126
  • 2