2

I am using a the PYTHONSTARTUP=~/pythonstartup.py approach in order to make ipython the default python shell but I want to extend it do have some additional imports by default (like importing few common packages).

How can I do that?

#!/usr/bin/env python
import os
import sys
import re
import time
import platform
import IPython

os.environ['PYTHONSTARTUP'] = ''  # Prevent running this again
IPython.start_ipython()
raise SystemExit

1 Answer 1

2

Problem solved by adding

IPython.start_ipython(user_ns=locals())
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.