r/IPython • • Feb 28 '15

What exactly is IPython?

Hello,

I am relatively new to learning Python, and am confused by exactly what IPython is. Is it an implementation of Python like CPython, Jython, PyPy et al.? Or is it more like an IDE like Eric or Spyder? Or is it an IDE that is integrated with its own implementation of Python? Would the Notebook be part of that IDE? Is there an ELI5 explanation for how to conceptualise IPython?

Thanks!!

15 Upvotes

20 comments sorted by

View all comments

Show parent comment

1

u/avamk Mar 01 '15

Have you ever just typed "python" at a terminal prompt and then messed around with simple Python statements? That's the Python interactive shell. IPython is just like Python, but with more goodies in the interactive shell.

Thanks that analogy (not sure if that's the right word...) is very helpful! Thank you!

OK, so the first video said something about IPython being "better than bash" in a number of ways. Wait, so IPython is also a general-use shell that can replace bash? Kind of like bash but with Python as a "language"??

I guess another follow up question to your answer is that since "IPython is just like Python", is it a drop in replacement for "regular" Python? I.e. Can I just install IPython from my package manager and not even bother with the usual Python?

2

u/hharison Mar 01 '15

OK, so the first video said something about IPython being "better than bash" in a number of ways. Wait, so IPython is also a general-use shell that can replace bash? Kind of like bash but with Python as a "language"??

I don't really agree with that characterization. One of the features of IPython is that you can run shell commands from the IPython console with the ! character. But it's not a better Bash any more than Python is a better Bash. It's a better Python terminal. For example, if you copy-paste code into it, it will fix the indentation for you (most of the time, if it can figure it out). If you put a question mark after a function, it will display its help. Things like that.

I guess another follow up question to your answer is that since "IPython is just like Python", is it a drop in replacement for "regular" Python? I.e. Can I just install IPython from my package manager and not even bother with the usual Python?

Yes, but if you do that your package manager will install Python as a dependency of IPython. Once you have IPython you never need to use regular Python directly, but every time you use IPython you are still using Python, just one relatively thin layer removed.

1

u/avamk Mar 01 '15

Aha! I think this is starting to make sense to me now in conjunction with /u/hharison 's answer.

Sounds fun, I think I'll give it a try as I continue to learn Python. Thank you!

2

u/[deleted] Mar 01 '15

It's a stretch to say it is better than Bash.

Having said that, it is was possible to literally use IPython as a replacement for your shell. I tried it for a few months and didn't enjoy it.