Ben Chuanlong Du's Blog

It is never too late to learn.

Use Jedi for Autocompletion in Python

Below is an example of auto completion using Jedi in Python.

In [2]:
import jedi

source = """
def foo(bar: str):
    print(bar.lo)
""".strip()
script = jedi.Script(source, 2, len("    print(bar.lo"))
print(script.completions())
[<Completion: lower>]
In [ ]:
 

Comments