Coder Social home page Coder Social logo

prompt-toolkit / python-prompt-toolkit Goto Github PK

View Code? Open in Web Editor NEW
9.0K 149.0 704.0 9.32 MB

Library for building powerful interactive command line applications in Python

Home Page: https://python-prompt-toolkit.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

python-prompt-toolkit's Introduction

Python Prompt Toolkit

AppVeyor Latest Version RTD License Codecov

prompt_toolkit is a library for building powerful interactive command line applications in Python.

Read the documentation on readthedocs.

ptpython is an interactive Python Shell, build on top of prompt_toolkit.

More examples

prompt_toolkit features

prompt_toolkit could be a replacement for GNU readline, but it can be much more than that.

Some features:

  • Pure Python.
  • Syntax highlighting of the input while typing. (For instance, with a Pygments lexer.)
  • Multi-line input editing.
  • Advanced code completion.
  • Both Emacs and Vi key bindings. (Similar to readline.)
  • Even some advanced Vi functionality, like named registers and digraphs.
  • Reverse and forward incremental search.
  • Works well with Unicode double width characters. (Chinese input.)
  • Selecting text for copy/paste. (Both Emacs and Vi style.)
  • Support for bracketed paste.
  • Mouse support for cursor positioning and scrolling.
  • Auto suggestions. (Like fish shell.)
  • Multiple input buffers.
  • No global state.
  • Lightweight, the only dependencies are Pygments and wcwidth.
  • Runs on Linux, OS X, FreeBSD, OpenBSD and Windows systems.
  • And much more...

Feel free to create tickets for bugs and feature requests, and create pull requests if you have nice patches that you would like to share with others.

Installation

pip install prompt_toolkit

For Conda, do:

conda install -c https://conda.anaconda.org/conda-forge prompt_toolkit

About Windows support

prompt_toolkit is cross platform, and everything that you build on top should run fine on both Unix and Windows systems. Windows support is best on recent Windows 10 builds, for which the command line window supports vt100 escape sequences. (If not supported, we fall back to using Win32 APIs for color and cursor movements).

It's worth noting that the implementation is a "best effort of what is possible". Both Unix and Windows terminals have their limitations. But in general, the Unix experience will still be a little better.

Getting started

The most simple example of the library would look like this:

from prompt_toolkit import prompt

if __name__ == '__main__':
    answer = prompt('Give me some input: ')
    print('You said: %s' % answer)

For more complex examples, have a look in the examples directory. All examples are chosen to demonstrate only one thing. Also, don't be afraid to look at the source code. The implementation of the prompt function could be a good start.

Philosophy

The source code of prompt_toolkit should be readable, concise and efficient. We prefer short functions focusing each on one task and for which the input and output types are clearly specified. We mostly prefer composition over inheritance, because inheritance can result in too much functionality in the same object. We prefer immutable objects where possible (objects don't change after initialization). Reusability is important. We absolutely refrain from having a changing global state, it should be possible to have multiple independent instances of the same code in the same process. The architecture should be layered: the lower levels operate on primitive operations and data structures giving -- when correctly combined -- all the possible flexibility; while at the higher level, there should be a simpler API, ready-to-use and sufficient for most use cases. Thinking about algorithms and efficiency is important, but avoid premature optimization.

Special thanks to

  • Pygments: Syntax highlighter.
  • wcwidth: Determine columns needed for a wide characters.

python-prompt-toolkit's People

Contributors

amjith avatar asmeurer avatar bitkeen avatar byrro avatar carreau avatar danirus avatar decentral1se avatar delirious-lettuce avatar donnemartin avatar farisachugthai avatar gpotter2 avatar hugovk avatar infmagic2047 avatar jonathanslenders avatar joouha avatar kitterma avatar melund avatar mrmino avatar msabramo avatar niklasf avatar pgy avatar pqyplzxhgf avatar pythonpsql avatar randy3k avatar sinic avatar techtonik avatar tony avatar tsvenson avatar vicalloy avatar vxgmichel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-prompt-toolkit's Issues

no attribute `on_input_timeout`

I'm making a tiny django package which lets ptipython be used as the Django shell.

https://github.com/joequery/django-ptshell

Everything works pretty well, but I did run into this randomly

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/home/vagrant/envs/django1.6/local/lib/python2.7/site-packages/prompt_toolkit/__init__.py", line 200, in run
    callback()
  File "/home/vagrant/envs/django1.6/local/lib/python2.7/site-packages/prompt_toolkit/contrib/python_input.py", line 559, in run
    self.on_input_timeout()
AttributeError: 'IPythonCommandLineInterface' object has no attribute 'on_input_timeout'

The line mentioned: https://github.com/jonathanslenders/python-prompt-toolkit/blob/master/prompt_toolkit/contrib/python_input.py#L559

I don't know how to reproduce this, but I believe removing the preceding self will take care of the issue since on_input_timeout() is a nested function.

ptipython always prompts `In [1]:`

Example:

[~]$ ptipython
Python 2.7.8 (default, Aug 24 2014, 21:26:19)
Type "copyright", "credits" or "license" for more information.

IPython 2.2.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: 1 + 1
Out[1]: 2

In [1]: 2 + 2
Out[2]: 4

In [1]:

ptipython pollutes global

Initialization of ptipython (and ptpython as well) leaves many globals.
Running dir() in ipython:

['In',
 'Out',
 '_',
 '_1',
 '__',
 '___',
 '__builtin__',
 '__builtins__',
 '__doc__',
 '__loader__',
 '__name__',
 '__package__',
 '__spec__',
 '_dh',
 '_i',
 '_i1',
 '_i2',
 '_ih',
 '_ii',
 '_iii',
 '_oh',
 '_sh',
 'exit',
 'get_ipython',
 'quit']

As you can see the only non private/internal attributes are In, Out, exit, get_ipython, quit

While running dir() in ptipython gives:

['IPython',
 'In',
 'Out',
 '_',
 '_1',
 '__',
 '___',
 '_dh',
 '_i',
 '_i1',
 '_i2',
 '_ih',
 '_ii',
 '_iii',
 '_oh',
 '_sh',
 'a',
 'always_multiline',
 'autocompletion_style',
 'embed',
 'exit',
 'get_ipython',
 'history_filename',
 'quit',
 'vi_mode']

In this case, I think IPython, a, always_multiline, autocompletion_sytle, ... should be at least prefixed with _ or not be there at all

IndexError while making recursive function

IndexError was thrown while typing the following:

โžœ  ~  ptpython --vi
In [1]: def bez(cps, t):
    2.     if len(cps) < 2:                        
    3.         return cps[0]                           
    4.     p1 = bez(cps[0:
                        ^--- Exception happened here

Full output:

โžœ  ~  ptpython --vi
In [1]: def bez(cps, t):
     2.     if len(cps) < 2:                        
     3.         return cps[0]                           
     4.     p1 = bez(Traceback (most recent call last):
  File "/usr/local/bin/ptpython", line 80, in <module>
    _run_repl()       all                        
  File "/usr/local/bin/ptpython", line 77, in _run_repl
    startup_paths=startup_paths, always_multiline=always_multiline)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/contrib/repl.py",d
    cli.start_repl(startup_paths=startup_paths)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/contrib/repl.py",l
    on_exit=AbortAction.RAISE_EXCEPTION)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/__init__.py", lint
    self._redraw()
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/__init__.py", linw
    self.renderer.render(self)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/renderer.py", linr
    output = self.render_to_str(cli)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/renderer.py", linr
    self.layout.write_to_screen(cli, screen, height)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/layout/__init__.pn
    t.write(cli, screen)z(cps, t)                                               
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/layout/toolbars.pe
    tokens = self.get_tokens(cli, width)
  File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/contrib/python_ins
    append((Signature, sig.full_name))
  File "/usr/local/lib/python2.7/dist-packages/jedi/api/classes.py", line 295, e
    path = [unicode(p) for p in self._path()]
  File "/usr/local/lib/python2.7/dist-packages/jedi/api/classes.py", line 170, h
    path.insert(0, par.name)
  File "/usr/local/lib/python2.7/dist-packages/jedi/api/interpreter.py", line 3_
    return getattr(self.parser_module, name)
  File "/usr/local/lib/python2.7/dist-packages/jedi/parser/fast.py", line 38, i_
    return getattr(self.parsers[0].module, name)
IndexError: list index out of range

Autocomplete does not introspect imported anything

By running source env/bin/activate then ptipython I do not get the same code completion support iPython provides. After importing classes from my project I can run any command and get the results I expect, but code completion does not work at all.

Hylang support?

Hello there. I was wondering how easy it would be to build in Hy support, since this would make an absolutely killer REPL for it.

Can't run python ptpython on Windows

My python is 2.7.8,Windows 7 x64. I used pip to install prompt-toolkit,but when I run python ptpython it raise a ImportError .

F:\Python27\Scripts>python ptpython
Traceback (most recent call last):
  File "ptpython", line 26, in <module>
    from prompt_toolkit.contrib.repl import embed
  File "F:\Python27\lib\site-packages\prompt_toolkit\__init__.py", line 9, in <module>
    import fcntl
ImportError: No module named fcntl

I google and try to fix it, but I got another error ImportError: No module named termios.

IPython '?' magic doesn't work

In IPython ? and ??: Typing ? after a name will give you information about the object attached to that name. The prompt toolkit raises a syntax error for this. Would love to see this implemented.

completions error : 'generator' object has no attribute '__objclass__'

a = (x for x in range(10))
Then, as you type a( , jedi complains as following

In [1]: a=(x for x in range(10)) 

In [2]: a(Exception in thread Thread-4:
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/jedi/cache.py", line 137, in wrap
    return getattr(self, name)
AttributeError: 'LazyName' object has no attribute '_parent'
 ~
During handling of the above exception, another exception occurred:r] Execute > 

Traceback (most recent call last):
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/compiled/__init__.p
    return evaluator.compiled_cache[key][0]
KeyError: (4511290496, 4510349128, 4510349128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.4.2_1/Frameworks/Python.framework/Versions/3
    self.run()
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/eventloop/base.py"
    callback()
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/__init__.py", line
    completions = list(line.completer.get_completions(document))
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/python_inp
    completions = script.completions()
  File "/usr/local/lib/python3.4/site-packages/jedi/api/__init__.py", line 161, 
    for call_sig in self.call_signatures():
  File "/usr/local/lib/python3.4/site-packages/jedi/api/__init__.py", line 574, 
    self._pos, user_stmt)
  File "/usr/local/lib/python3.4/site-packages/jedi/cache.py", line 90, in wrapp
    value = optional_callable()
  File "/usr/local/lib/python3.4/site-packages/jedi/api/__init__.py", line 572, 
    _callable = lambda: self._evaluator.eval_call(stmt_el)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/__init__.py", line 
    return self.eval_call_path(path, par, s.start_pos)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/__init__.py", line 
    search_global=True)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/__init__.py", line 
    return f.find(scopes, resolve_decorator, search_global)
  File "/usr/local/lib/python3.4/site-packages/jedi/debug.py", line 51, in wrapp
    result = func(*args, **kwargs)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/finder.py", line 46
    names = self.filter_name(scopes)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/finder.py", line 89
    scope = name.parent.parent
  File "/usr/local/lib/python3.4/site-packages/jedi/cache.py", line 139, in wrap
    result = func(self)
  File "/usr/local/lib/python3.4/site-packages/jedi/api/interpreter.py", line 97
    return compiled.create(self._evaluator, self._value, module, module)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/compiled/__init__.p
    result = func(evaluator, obj, parent, module)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/compiled/__init__.p
    faked = fake.get_faked(module and module.obj, obj)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/compiled/fake.py", 
    result = _faked(module, obj, name)
  File "/usr/local/lib/python3.4/site-packages/jedi/evaluate/compiled/fake.py", 
    cls = search_scope(faked_mod, obj.__objclass__.__name__)
AttributeError: 'generator' object has no attribute '__objclass__'

mosh [mobile shell] compatibility

When connected via mosh the ptpython console is broken and blinking. I guess this might have something to do with the VT100 requirement, so it's not a bug but a design limitation? My expertise is non-existent here.

[feature request? bug?] iPython up-arrow partial string matching doesn't work

iPython does partial string matching from its history when using the up arrow. For instance, if you have previously executed:

import abacus
import monkeypants
import mvpa_stuff_ex
import zebra

and later you type:

import mv

and then hit up arrow, iPython will match history based on the existing input line and only present you with a possibly-matching option. This no longer happens when using ptipython. Presumably it's because the ptpython family is doing its own stuff with the arrows to support cool features like multi-line editing and selecting from options in completion-matching; but this history-substring-matching in iPython is a must-have for me. Could ptipython be compelled to allow iPython's behavior to pass through?

AttributeError: 'module' object has no attribute 'unichr'

getting the following traceback when running ptpython:

ptpython
Traceback (most recent call last):
File "/usr/local/bin/ptpython", line 24, in
from prompt_toolkit.contrib.repl import embed
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/init.py", line 32, in
from .layout import Layout
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/layout/init.py", line 8, in
from ..renderer import Screen, Size, Point, Char
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/renderer.py", line 42, in
_CHAR_SIZES_CACHE = [wcwidth(six.unichr(i)) for i in range(0, 64000)]
AttributeError: 'module' object has no attribute 'unichr'

installed freshly via pip, terminal is a gnome-terminal running zsh, wm is awesome, OS is debian wheezy, let me know if you need more information

Strange behaviour with IPython -> Plot window hangs prompt

This is using python3.4.1, on Windows 7 Professional 64 bit, with the latest IPython, as well as numpy / scipy / matplotlib.

I was just playing around with the experimental windows support, just to test out the features (like autocompletion, ipython integration, etc). Anyways, the first thing I usually do is try out matplotlib, to see if it's working / loading correctly.

$ ptipython --vi
In [1]: %pylab
Using matplotlib backend: TkAgg
Populating the interactive namespace from numpy and matplotlib
In [2]: plot([1,2,3,4], 'r')
Out[2]: [<matplotlib.lines.Line2D at 0x5c92ed0>]

This should, ideally, plot a single figure window with the line x = y in it. It draws the window, but the plot inside cannot be seen. What's more, if you try to interact with the window in any way, it crashes the python instance.

So I figured I'd try the same thing by pasting the relevant matplotlib code directly from python.

# File: test.py
import matplotlib.pyplot as plt
plt.plot([1,2,3,4], 'r')
plt.show()

This works, but there is a drawback, ptpython (and of course, ptipython) both plot the figure, but do not return the prompt until the window with the plot is closed. This is somewhat of a serious flaw, as it requires you can't use plots / data visualization interactively.

Unfortunately, I have not really narrowed down the factors as to why these bugs are apparent. I had initially thought it had something to do with ipython, but running the code listed in test.py in ptpython exhibits the same behaviour. However, there does appear to be some issue using %pylab and its associated functions (calling plot directly) in ptipython. In any case, I'll check when I get home and have access to a Linux machine to see if this behaviour is replicable there as well.

UnicodeDecodeError on OpenBSD

Hi,

I installed prompt-toolkit from pip on OpenBSD to try out ptipython. It's awesome. Nice work!

There is however an annoying bug. If i start a fresh ptipython and type 'import s' the following happens:

In [1]: import sException in thread Thread-8:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/home/edd/.local/lib/python2.7/site-packages/prompt_toolkit/__init__.pyn
    callback()
  File "/home/edd/.local/lib/python2.7/site-packages/prompt_toolkit/__init__.pyn
    completions = list(line.completer.get_completions(document))
  File "/home/edd/.local/lib/python2.7/site-packages/prompt_toolkit/contrib/ipys
    for c in super(IPythonCompleter, self).get_completions(document):
  File "/home/edd/.local/lib/python2.7/site-packages/prompt_toolkit/contrib/pyts
    completions = script.completions()
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/api/__init__.py", lins
    completions = get_completions(user_stmt, b)
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/api/__init__.py", lins
    return self._simple_complete(path, like)
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/api/__init__.py", line
    return super(Interpreter, self)._simple_complete(path, like)
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/api/__init__.py", line
    names = s.get_defined_names(on_import_stmt=True)
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/evaluate/imports.py",s
    names += self._get_module_names([path])
  File "/home/edd/.local/lib/python2.7/site-packages/jedi/evaluate/imports.py",s
    for module_loader, name, is_pkg in pkgutil.iter_modules(search_path):
  File "/usr/local/lib/python2.7/pkgutil.py", line 147, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "/usr/local/lib/python2.7/pkgutil.py", line 202, in iter_modules
    filenames.sort()  # handle packages before same-named modules
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 25: ordina)

Packages:

$ pkg_info | grep python-2
ipython-2.1.0p1     enhanced interactive Python shell
python-2.7.8        interpreted object-oriented programming language

Locale:

$ echo $LC_CTYPE
en_US.UTF-8

Could be a bug in Python on OpenBSD of course.

Any ideas?

Creating class with super

I tried creating a custom exception:

class CustomException(Exception):
    def __init__(self, *args, **kwargs):
        super(CustomException, self).__init__(*args, **kwargs)

Creating this exception works, but trying to raise it gives me:

>>> raise CustomException
NameError                                 Traceback (most recent call last)
/usr/local/lib/python2.7/dist-packages/prompt_toolkit/contrib/entry_points/ptipython.pyc in __init__(self, *args, **kwargs)
1 class CustomException(Exception):
2     def __init__(self, *args, **kwargs):
----> 3         super(CustomException, self).__init__(self, *args, **kwargs)
4
5
NameError: global name 'CustomException' is not defined

jedi as optional dependency

Any chance that jedi is made an optional dependency?

Using prompt-toolkit to build cli's jedi is often not required.

Problem with functions I create

To recreate - define a simple function, and try and call it.

Adams-MacBook-Pro:tmp adam$ ptpython 
In [1]: def square(x):
     2.     return x*x                            
     3.                        

In [2]: square(Exception in thread Thread-36:
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
    self.run()
  File "/Library/Python/2.7/site-packages/prompt_toolkit/__init__.py", line 200, in run
    callback()
  File "/Library/Python/2.7/site-packages/prompt_toolkit/__init__.py", line 440, in run 2.7.5                                                         
    completions = list(line.completer.get_completions(document))
  File "/Library/Python/2.7/site-packages/prompt_toolkit/contrib/python_input.py", line 449, in get_completions
    for c in script.completions():
  File "/Library/Python/2.7/site-packages/jedi/api/__init__.py", line 161, in completions
    for call_sig in self.call_signatures():
  File "/Library/Python/2.7/site-packages/jedi/api/__init__.py", line 574, in call_signatures
    self._pos, user_stmt)
  File "/Library/Python/2.7/site-packages/jedi/cache.py", line 90, in wrapper
    value = optional_callable()
  File "/Library/Python/2.7/site-packages/jedi/api/__init__.py", line 572, in <lambda>
    _callable = lambda: self._evaluator.eval_call(stmt_el)
  File "/Library/Python/2.7/site-packages/jedi/evaluate/__init__.py", line 226, in eval_call
    return self.eval_call_path(path, par, s.start_pos)
  File "/Library/Python/2.7/site-packages/jedi/evaluate/__init__.py", line 240, in eval_call_path
    search_global=True)
  File "/Library/Python/2.7/site-packages/jedi/evaluate/__init__.py", line 113, in find_types
    return f.find(scopes, resolve_decorator, search_global)
  File "/Library/Python/2.7/site-packages/jedi/debug.py", line 51, in wrapper
    result = func(*args, **kwargs)
  File "/Library/Python/2.7/site-packages/jedi/evaluate/finder.py", line 46, in find
    names = self.filter_name(scopes)
  File "/Library/Python/2.7/site-packages/jedi/evaluate/finder.py", line 89, in filter_name
    scope = name.parent.parent
  File "/Library/Python/2.7/site-packages/jedi/cache.py", line 139, in wrapper
    result = func(self)
  File "/Library/Python/2.7/site-packages/jedi/api/interpreter.py", line 69, in parent
    module = __import__(module_name)
TypeError: __import__() argument 1 must be string, not None

Note the exception occurs after hitting the bracket in "square(" after calling the first time

This is OS X Mavericks with latest standard OS python (e.g. standard/latest Mac)

Adams-MacBook-Pro:tmp adam$ uname -a     
Darwin Adams-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64
Adams-MacBook-Pro:tmp adam$ python -V
Python 2.7.5
Adams-MacBook-Pro:tmp adam$ pip freeze | grep prompt
prompt-toolkit==0.18

detect key-bindings from .inputrc

Would be nice if an application built using prompt-toolkit behaves the same way as applications based on readline in that they use the input mode that is set in /etc/inputrc or ~/.inputrc.

Or do you think that the logic to detect the right keybinding should be part of the application and not within the prompt-toolkit library?

ptipython raises KeyError: 'extensions'

Traceback:

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
/usr/local/bin/ptipython in <module>()
      7 if __name__ == '__main__':
      8     sys.exit(
----> 9         load_entry_point('prompt-toolkit==0.23', 'console_scripts', 'ptipython')()
     10     )

/usr/local/lib/python3.4/dist-packages/prompt_toolkit/contrib/entry_points/ptipython.py in run()
     73               autocompletion_style=autocompletion_style,
     74               always_multiline=always_multiline,
---> 75               user_ns=user_ns)
     76 
     77 

/usr/local/lib/python3.4/dist-packages/prompt_toolkit/contrib/ipython.py in embed(**kwargs)
    176         kwargs['config'] = config
    177     shell = InteractiveShellEmbed.instance(**kwargs)
--> 178     initialize_extensions(shell, config['InteractiveShellApp']['extensions'])
    179     shell(header=header, stack_depth=2, compile_flags=compile_flags)

/usr/lib/python3/dist-packages/IPython/config/loader.py in __getitem__(self, key)
    171                 return c
    172         else:
--> 173             return dict.__getitem__(self, key)
    174 
    175     def __setitem__(self, key, value):

KeyError: 'extensions'

crash when I input "for i in range(1,"

In [1]: for i in range(1
Traceback (most recent call last):
File "/usr/local/bin/ptpython", line 71, in
_run_repl()
File "/usr/local/bin/ptpython", line 68, in _run_repl
startup_paths=startup_paths, always_multiline=always_multiline)
File "/Library/Python/2.7/site-packages/prompt_toolkit/contrib/repl.py", line 139, in embed
cli.start_repl(startup_paths=startup_paths)
File "/Library/Python/2.7/site-packages/prompt_toolkit/contrib/repl.py", line 47, in start_repl
on_exit=AbortAction.RAISE_EXCEPTION)
File "/Library/Python/2.7/site-packages/prompt_toolkit/init.py", line 317, in read_input
c = self._get_char_loop()
File "/Library/Python/2.7/site-packages/prompt_toolkit/init.py", line 237, in _get_char_loop
c()
File "/Library/Python/2.7/site-packages/prompt_toolkit/init.py", line 189, in _redraw
self.renderer.render(self)
File "/Library/Python/2.7/site-packages/prompt_toolkit/renderer.py", line 537, in render
output = self.render_to_str(cli)
File "/Library/Python/2.7/site-packages/prompt_toolkit/renderer.py", line 523, in render_to_str
self.layout.write_to_screen(cli, screen, height)
File "/Library/Python/2.7/site-packages/prompt_toolkit/layout/init.py", line 290, in write_to_screen
t.write(cli, screen)
File "/Library/Python/2.7/site-packages/prompt_toolkit/layout/toolbars.py", line 29, in write
tokens = self.get_tokens(cli, width)
File "/Library/Python/2.7/site-packages/prompt_toolkit/contrib/python_input.py", line 286, in get_tokens
append((Signature, sig.full_name))
AttributeError: 'CallDef' object has no attribute 'full_name'

Cannot open ptpython after installation.

I use the

sudo pip install ptpyton

suggested in your README.rst. But after execute in terminal, the output is this:

Traceback (most recent call last):
  File "/usr/bin/ptpython", line 9, in <module>
    load_entry_point('prompt-toolkit==0.25', 'console_scripts', 'ptpython')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 348, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2311, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2025, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/prompt_toolkit/contrib/entry_points/ptpython.py", line 26, in <module>
    from prompt_toolkit.contrib.repl import embed
  File "/usr/lib/python2.7/site-packages/prompt_toolkit/contrib/repl.py", line 20, in <module>
    from prompt_toolkit.contrib.python_input import PythonCommandLineInterface, PythonStyle, AutoCompletionStyle
  File "/usr/lib/python2.7/site-packages/prompt_toolkit/contrib/python_input.py", line 37, in <module>
    import jedi
  File "/usr/lib/python2.7/site-packages/jedi/__init__.py", line 45, in <module>
    from .api import Script, Interpreter, NotFoundError, set_debug_function
  File "/usr/lib/python2.7/site-packages/jedi/api/__init__.py", line 18, in <module>
    from jedi.parser import Parser
  File "/usr/lib/python2.7/site-packages/jedi/parser/__init__.py", line 23, in <module>
    from jedi.parser import representation as pr
  File "/usr/lib/python2.7/site-packages/jedi/parser/representation.py", line 41, in <module>
    from jedi._compatibility import (next, Python3Method, encoding, unicode,
ImportError: cannot import name is_py3

FYI:

It works fine when I'm using Fedora 20, but now it outputs errors like above after upgrading to Fedora 21. I've tried to uninstall it, but it doesn't work.

embed REPL in Django app

Hello, I'm trying to embed a REPL in a Django app, and I've placed

from prompt_toolkit.contrib.repl import embed
embed(globals(), locals(), vi_mode=False, history_filename=None)

where I'd normally place pdb.set_trace(). Unfortunately, I'm having the following problem:

Exception Type: ValueError
Exception Value:     signal only works in main thread
Exception Location: /vagrant/src/me/.venv/local/lib/python2.7/site-packages/prompt_toolkit/utils.py in __enter__, line 76

Crash while typing out a for-loop.

Incorrectly typing a for loop will cause an ugly crash before pressing Enter.

Example:

for i in range)
#!#! CRASH

Output:

In [1]: for i in range)Exception in thread Thread-13:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "build/bdist.linux-x86_64/egg/prompt_toolkit/__init__.py", line 200, in run
    callback()
  File "build/bdist.linux-x86_64/egg/prompt_toolkit/__init__.py", line 440, in run                                                                                           
    completions = list(line.completer.get_completions(document))
  File "build/bdist.linux-x86_64/egg/prompt_toolkit/contrib/python_input.py", line 449, in get_completions
    for c in script.completions():
  File "/home/cj/.local/lib/python2.7/site-packages/jedi-0.8.1_final0-py2.7.egg/jedi/api/__init__.py", line 187, in completions
    new = classes.Completion(self._evaluator, c, needs_dot, len(like), s)
  File "/home/cj/.local/lib/python2.7/site-packages/jedi-0.8.1_final0-py2.7.egg/jedi/api/classes.py", line 375, in __init__
    super(Completion, self).__init__(evaluator, name.parent, name.start_pos)
  File "/home/cj/.local/lib/python2.7/site-packages/jedi-0.8.1_final0-py2.7.egg/jedi/cache.py", line 139, in wrapper
    result = func(self)
  File "/home/cj/.local/lib/python2.7/site-packages/jedi-0.8.1_final0-py2.7.egg/jedi/api/interpreter.py", line 69, in parent
    module = __import__(module_name)
TypeError: __import__() argument 1 must be string, not None

Originally I was running with Python 3.4 when I found it. I switched to Python 2.7 just to see if it was compatible with both, and then decided to see if it would crash again.

KeyboardInterrupt will regain the prompt, and then it won't crash on the same input. You lose the auto-complete though.

Error when writing "yield"

I don't know if it's only me...

I've downloaded and installed from sources, I run ptipython, and start writing "yield", at the same time that I write the last character, I get that error:

In [1]: yieldException in thread Thread-7:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 921, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 869, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/__init__.py", line 400, in run                                                     
    completions = list(line.completer.get_completions(document))
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/contrib/ipython.py", line 69, in get_completions
    for c in super(IPythonCompleter, self).get_completions(document):
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/contrib/python_input.py", line 477, in get_completions
    script = get_jedi_script_from_document(document, self.get_locals(), self.get_globals())
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/contrib/python_input.py", line 457, in get_jedi_script_from_document
    namespaces=[locals, globals])
  File "/usr/lib/python3.4/site-packages/jedi-0.8.1_final0-py3.4.egg/jedi/api/__init__.py", line 642, in __init__
    interpreter.create(self._evaluator, namespaces[0], self._parser.module())
  File "/usr/lib/python3.4/site-packages/jedi-0.8.1_final0-py3.4.egg/jedi/api/interpreter.py", line 108, in create
    something.parent = ns
AttributeError: 'NoneType' object has no attribute 'parent'

Exception in thread Thread-8:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 921, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 869, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/contrib/python_input.py", line 579, in run
    script = get_jedi_script_from_document(document, self.get_locals(), self.get_globals())
  File "/usr/lib/python3.4/site-packages/prompt_toolkit-0.22-py3.4.egg/prompt_toolkit/contrib/python_input.py", line 457, in get_jedi_script_from_document
    namespaces=[locals, globals])
  File "/usr/lib/python3.4/site-packages/jedi-0.8.1_final0-py3.4.egg/jedi/api/__init__.py", line 642, in __init__
    interpreter.create(self._evaluator, namespaces[0], self._parser.module())
  File "/usr/lib/python3.4/site-packages/jedi-0.8.1_final0-py3.4.egg/jedi/api/interpreter.py", line 108, in create
    something.parent = ns
AttributeError: 'NoneType' object has no attribute 'parent'

Resizing terminal window on OSX behaves weirdly

Write a really long line so that line break kicks in, then take the corner of the window and wiggle it. The resizing is partially correct, but multiple errors when resizing accumulate. Lots of extra blank lines are created and other artifacts show up.

Add ptpython support to Django's shell

This is less an issue, and more a helpful tip that may be worth adding to the README. It's really simple to add ptpython support to Django's manage.py shell command. Just add this gist as a manage command in any app in your project.

from django.core.management.commands.shell import Command as ShellCommand


class Command(ShellCommand):
    shells = ['ptpython', 'ipython', 'bpython']

    def ptpython(self):
        from prompt_toolkit.contrib.repl import embed
        embed(globals(), locals(), vi_mode=False, history_filename=None)

[feature request] File name completion

IPython has file name completion, which is useful with %magic commands, and when you're putting filenames into strings. Is that a possibility for a future version?

PS - this is a great piece of software. Using IPython on its own feels primitive without it! Keep up the incredible work! And thank you!

crashes when completing after right bracket )

Input () and press tab, it will crash. So does [], {}...
Maybe something is wrong with jedi.
The following is ERR message:

In [1]: {}Traceback (most recent call last):
  File "/usr/local/bin/ptpython", line 60, in <module>
    _run_repl()6] Paste mode (off) [F7] Multiline (off) - CPython 3.4.2         
  File "/usr/local/bin/ptpython", line 57, in _run_repl
    startup_path=startup_path)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/repl.py", 
    cli.start_repl(startup_path=startup_path)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/repl.py", 
    on_exit=AbortAction.RAISE_EXCEPTION)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/__init__.py", line
    stream.feed(c)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/inputstream.py", l
    self._input_parser.send(c)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/inputstream.py", l
    self._call_handler(options[c])
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/inputstream.py", l
    self._input_processor.feed_key(key)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/key_binding.py", l
    self._process_coroutine.send(key_press)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/key_binding.py", l
    self._call_handler((exact_matches_with_mode or exact_matches)[0][1], key_seq
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/key_binding.py", l
    handler.call(event)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/key_binding.py", l
    return self._callable(event)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/python_inp
    line.complete_next()
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/line.py", line 403
    self._start_complete()
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/line.py", line 437
    current_completions = list(self.create_code_obj().get_completions())
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/python_inp
    yield PythonCompletion(c.name, len(c.complete) - len(c.name), c)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/contrib/python_inp
    super(PythonCompletion, self).__init__(text, start_position)
  File "/usr/local/lib/python3.4/site-packages/prompt_toolkit/code.py", line 33,
    assert self.start_position <= 0
AssertionError

Triggering Completer when calling CommandLineInterface.read_input()?

I'm hacking up a little utility and was looking through the examples, but couldn't figure out if there was a simple way to automatically bring up my Completer when calling CommandLineInterface.read_input() (w/o digging through the guts of the lib)?

Also, is there a way to also assign autocompletion to different keys (ie, to the down key as well perhaps)?

Lastly, I'm doing a rather ugly hack (reading a global List) to be able to dynamically populate the Completer - the completers are generated anonymously on every keystroke it looks like? Just want to make sure I'm not missing anything there...

pypython crashes when Control chars are pressed with auto-completion menu open

Ways to reproduce it:

$ ptpython
In [1]: import sys<tab>^W

Stacktrace:

 File "/Users/amjith/.virtualenvs/prompt-toolkit/bin/ptpython", line 60, in <module>
    _run_repl()    sysconfig
  File "/Users/amjith/.virtualenvs/prompt-toolkit/bin/ptpython", line 57, in _run_repl
    startup_path=startup_path)s
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tod
    cli.start_repl(startup_path=startup_path)line (off) - CPython 2.7.5
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tol
    on_exit=AbortAction.RAISE_EXCEPTION)
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tot
    self._redraw()
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tow
    self.renderer.render()
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tor
    output = self.render_to_str(abort=abort, accept=accept)
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tor
    abort=abort, accept=accept)
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_ton
    y = self.write_input_scrolled(screen, (accept or abort), last_screen_height)
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tod
    super(PythonPrompt, self).write_input(temp_screen, highlight=not accept_or_abort)
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tot
    set_cursor_position=(index == self.line.cursor_position))
  File "/Users/amjith/.virtualenvs/prompt-toolkit/lib/python2.7/site-packages/prompt_tor
    self._buffer[self._y][self._x+1] = Char(six.unichr(0x110000-1))
ValueError: unichr() arg not in range(0x10000) (narrow Python build)

IPython Extensions not loaded

Because IPython is started using embed the extensions aren't loaded (IPython issue that's still not fixed ipython/ipython#1144). This means thing like autoreload don't work.

Is it possible to swap to using the standard IPython startup using TerminalIPythonApp instead? I don't understand all these embedding layers that are going on so that may not even make any sense.

"Interesting. I did find that Django had the same issue at one point, and an IPython developer suggested using a "standard ipython startup" with TerminalIPythonApp instead of embed()."

django/django#512

http://stackoverflow.com/questions/18257758/how-do-i-get-ipython-autoreload-magic-to-load-automatcially-when-using-an-embedd

DistributionNotFound exception with jedi version 0.8.1-final0

The most recent jedi version seems to be 0.8.1-final0, causing a DistributionNotFound exception during installation with setup.py or launching ptpython.
A possible workaround is to replace jedi-0.8.1 with jedi in setup.py.

~$ pip3 freeze | grep -iP 'jedi|prompt'
jedi==0.8.1-final0
prompt-toolkit==0.25

Smart auto-compete

Love to have something like this:

from urllib.parse import join  ==> urljoin

I used to see this feature in IntelliJ.

Automatically Leaving Mutiline Mode

Is there a reason multiline mode isn't exited automatically after a blank line as it is in the built-in repl and ipython? I would think at least making this an option would be desirable.

Scoping issues for generators

When using an imported method within a generator an error is thrown of NameError: global name 'function' is not defined.

For example:

In [1]: from collections import Counter

In [2]: from random import randrange

In [3]: Counter(randrange(10) for _ in xrange(100))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
.virtualenvs/rolepoint-app/lib/python2.7/site-packages/prompt_toolkit/contrib/entry_points/ptipython.pyc in <module>()
----> 1 Counter(randrange(10) for _ in xrange(100))

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.pyc in __init__(self, iterable, **kwds)
    448         '''
    449         super(Counter, self).__init__()
--> 450         self.update(iterable, **kwds)
    451
    452     def __missing__(self, key):

/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.pyc in update(self, iterable, **kwds)
    529             else:
    530                 self_get = self.get
--> 531                 for elem in iterable:
    532                     self[elem] = self_get(elem, 0) + 1
    533         if kwds:

.virtualenvs/rolepoint-app/lib/python2.7/site-packages/prompt_toolkit/contrib/entry_points/ptipython.pyc in <genexpr>((_,))
----> 1 Counter(randrange(10) for _ in xrange(100))

NameError: global name 'randrange' is not defined

[ptipython] support bang-assign

IPython allows a = !ls to work, ptipython refuses is.

IIRC there is a methods to know if an input is complete in IPython, probably in IPython/core/inputsplitter.py.

IndexError

Not sure if this was already fixed. (I'm creating a ticket, just not to forget about this.)

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()DebtorSubscription
  File "/home/jonathan/git/prompt_toolkit/prompt_toolkit/eventloop/base.py", line 43, in run
    callback()
  File "/home/jonathan/git/prompt_toolkit/prompt_toolkit/__init__.py", line 399, in run
    completions = list(line.completer.get_completions(document))
  File "/home/jonathan/git/prompt_toolkit/prompt_toolkit/contrib/ipython.py", line 61, in get_completions
    for c in super(IPythonCompleter, self).get_completions(document):
  File "/home/jonathan/git/prompt_toolkit/prompt_toolkit/contrib/python_input.py", line 461, in get_completions
    script = get_jedi_script_from_document(document, self.get_locals(), self.get_globals())
  File "/home/jonathan/git/prompt_toolkit/prompt_toolkit/contrib/python_input.py", line 441, in get_jedi_script_from_document
    namespaces=[locals, globals])
  File "/home/jonathan/env/mobilevikings/local/lib/python2.7/site-packages/jedi/api/__init__.py", line 642, in __init__
    interpreter.create(self._evaluator, namespaces[0], self._parser.module())
  File "/home/jonathan/env/mobilevikings/local/lib/python2.7/site-packages/jedi/api/interpreter.py", line 107, in create
    for something in getattr(parser_module, attr_name):
  File "/home/jonathan/env/mobilevikings/local/lib/python2.7/site-packages/jedi/parser/fast.py", line 38, in __getattr__
    return getattr(self.parsers[0].module, name)
IndexError: list index out of range

AttributeError: 'module' object has no attribute 'unichr'

I have successfully installed python-toolkit. At first when i run the command i am getting error like following.
testuser@ubuntu-amd64:~$ ptpython
Traceback (most recent call last):
File "/usr/local/bin/ptpython", line 24, in <module>
from prompt_toolkit.contrib.repl import embed
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/__init__.py", line 32, in <module>
from .layout import Layout
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/layout/__init__.py", line 8, in <module>
from ..renderer import Screen, Size, Point, Char
File "/usr/local/lib/python2.7/dist-packages/prompt_toolkit/renderer.py", line 42, in <module>
_CHAR_SIZES_CACHE = [wcwidth(six.unichr(i)) for i in range(0, 64000)]
AttributeError: 'module' object has no attribute 'unichr'

Broken on Windows: ImportError: cannot import name KeyPress

This happens on Windows 8.1 and Python 2.7.9 (tested from https://github.com/jonathanslenders/python-prompt-toolkit/tree/d87196e3d46e9024117c477579a7fda4cab2be90)

C:\Users\ionel_000>ptpython
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "c:\Python27\Scripts\ptpython.exe\__main__.py", line 5, in <module>
  File "C:\Python27\lib\site-packages\prompt_toolkit\__init__.py", line 31, in <module>
    from .terminal.win32_input import raw_mode, cooked_mode
  File "C:\Python27\lib\site-packages\prompt_toolkit\terminal\win32_input.py", line 5, in <module>
    from ..key_binding import KeyPress
ImportError: cannot import name KeyPress

Calling ptpython seems to start ordinary Python REPL

I thought I'd succeeded in installing, after some brief trouble with issue #21(Unicode), but the ptpython prompt I'm getting looks just like the standard-issue Python triple arrow (only w/o the info about version, time, etc), and I'm not getting code completion, coloring, or anything special. Is there some variable I might have needed to set somewhere?

[feature request] use IPython zmq-interface

First super awesome project.

Looking at ipython integration I suppose it would be possible to use the two-process console that uses zmq in contrib/ipython.py It would have the nice addition of beeing able to use this with all the kernels supported by IPython, bipython is using a similar approach.

I might take a shot at that later.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.