Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

""" CLI for opening a Python interactive terminal 

""" 

import click 

 

 

@click.command('console', short_help='Enter cedar interactive console') 

@click.option('--ipython', is_flag=True, help='Use IPython console') 

@click.pass_context 

def console(ctx, ipython): 

""" Enter interactive Python shell with a Config 

""" 

from . import options 

config = options.fetch_config(ctx) 

 

banner = 'cedar interactive console' 

local = {'config': config} 

 

if ipython: 

import IPython 

IPython.InteractiveShell.banner1 = banner 

IPython.start_ipython(argv=[], user_ns=local) 

else: 

import code 

code.interact(banner, local=local)