Create empty ipythonrc.ini before launching ipython shell

This commit is contained in:
Kovid Goyal 2010-01-01 22:29:56 -07:00
parent 487588bb75
commit b713020a21

View File

@ -455,9 +455,10 @@ def ipython(user_ns=None):
os.environ['IPYTHONDIR'] = ipydir os.environ['IPYTHONDIR'] = ipydir
if not os.path.exists(ipydir): if not os.path.exists(ipydir):
os.makedirs(ipydir) os.makedirs(ipydir)
rc = os.path.join(ipydir, 'ipythonrc') for x in ('', '.ini'):
if not os.path.exists(rc): rc = os.path.join(ipydir, 'ipythonrc'+x)
open(rc, 'wb').write(' ') if not os.path.exists(rc):
open(rc, 'wb').write(' ')
UC = ''' UC = '''
import IPython.ipapi import IPython.ipapi
ip = IPython.ipapi.get() ip = IPython.ipapi.get()