| 74 | mshell.interact() |
| 75 | |
| 76 | def startConsole(vars2): |
| 77 | try: |
| 78 | import readline |
| 79 | import rlcompleter |
| 80 | if 'libedit' in readline.__doc__: |
| 81 | readline.parse_and_bind("bind ^I rl_complete") |
| 82 | else: |
| 83 | readline.parse_and_bind("tab: complete") |
| 84 | except: |
| 85 | try: |
| 86 | import pyreadline as readline |
| 87 | import rlcompleter |
| 88 | readline.parse_and_bind("tab:complete") # autocomplete |
| 89 | except: |
| 90 | print('readline not found') |
| 91 | shell = code.InteractiveConsole(vars2) |
| 92 | shell.push('from netgen import *') |
| 93 | shell.push('from ngsolve import *') |
| 94 | shell.interact(banner="NGS-Python console is up ...") |