3

bpython detects what libraries are installed and has autocompletion for codes that weren't previously written in the text, if you ever used bpython you know what I mean.

Sometimes i use bpython because i can't remember all the functions that a certain library has by default and bpython autocompletes it. Is that possible in emacs?

A plugin that detects what python libraries you have installed, either on the PC or in a virtualenv and predicts the name of the function you're calling based on that.

Originally I asked this question on askubuntu, it was about emacs and sublime text, and they told me that the emacs part can be answered here, so here I am!

7
  • Doesn't elpy do this? – Kirill Jan 4 '15 at 0:48
  • @Kirill will check it tomorrow thx :) it's 3am here, i'm not an emacs poweruser, I only use it when doing lisp and i don't do lisp that much nowadays :) – Lynob Jan 4 '15 at 0:56
  • So what happened? – Kirill Jan 9 '15 at 20:55
  • @Kirill well i guess jedi is my best option – Lynob Jan 9 '15 at 21:31
  • No, I mean, did elpy work? What features were missing? – Kirill Jan 9 '15 at 21:34
3

Python autocompletion provided by Jedi (see https://github.com/tkf/emacs-jedi for emacs integration) will provide something close to bpython autocompletion.

Jedi autocompletion is pretty great, but it's not quite bpython autocompletion; in bpython, there's less guessing because the environment in a bpython REPL session already exists, unlike the environment for a line of code in a file. It's generally a harder problem to know what attributes will exist on an object if you also have to predict what the object will be - but Jedi performs pretty admirably and I find it useful enough.

You may also be interested in bpython-curtsies along with the new "send session to editor" functionality (triggered by F7) which throws your entire session in emacs for modification, then re-executes it when you close the file. I like this workflow for combining the power of a text editor with the interactive features of bpython. You might also like "reimport," (F6) which reruns the entire bpython session including reimporting imported modules - another way to combine text editor and the REPL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.