mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Create empty ipythonrc.ini before launching ipython shell
This commit is contained in:
		
							parent
							
								
									487588bb75
								
							
						
					
					
						commit
						b713020a21
					
				@ -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()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user