r/learnpython • • Jul 12 '20

Jupyter Notebooks!

Jupyter Notebooks are the tool that turned the tables for me learning python. I'm just here to evangelize them. You can run your code line by line and debug as you go in a comfortable web browser interface. It's an excellent tool, and it made it so much more efficient to learn. Check it out.

425 Upvotes

127 comments sorted by

View all comments

57

u/Kevstuf Jul 12 '20

I’ve always been more of a fan of Spyder but sadly it doesn’t seem to be popular anywhere

22

u/HeinzHeinzensen Jul 12 '20

You‘ll love the notebook interface in VS Code then! Same cell-based execution and you have the variable explorer that people like from Spyder.

9

u/Notchez Jul 12 '20

Is it possible to set up VS code to look just like spyder? By that I don’t mean the cell by cell execution like in Jupiter but rather working with scripts (that are executable line by line of you want) and a variable explorer.

11

u/HeyItsRaFromNZ Jul 12 '20

You get very similar behavior (line-by-line execution, graphic output and pretty-printing dataframes etc.) by selecting a line and hitting shift+enter. If you have the main Python extension installed, it should open a new pane to the right with the output.

It's very similar to what you get with hitting F9 in Spyder's editing pane. Instead of a dedicated pane, introspection in VS Code is taken care of by a hovering tool-tip.

7

u/HeinzHeinzensen Jul 12 '20

You can see a workspace with open variable explorer here!

6

u/leweyy Jul 12 '20

God I hope you get an answer to this question

3

u/wolfmansideburns Self-taught Pythonista Jul 12 '20

Yes

5

u/Internet_employee Jul 12 '20

Oooh!! Thank you! I dropped Jupyter after discovering Spyder’s variable explorer, definitely giving VS Code a try now

4

u/mayankkaizen Jul 12 '20

Can you please point me to some resources about that? I use Jupyter notebooks and got VS Code on my machine. Although I don't use VS Code very much but would love to explore notebook interface in VS Code.

2

u/HeinzHeinzensen Jul 12 '20

Sure, this link should get you started.

3

u/miguelito_loveless Jul 12 '20

Thanks for the link. Still pretty beginner and 100% a happy VSC user and want to try this-- I couldn't get comfy w browser JN but get how useful that way of working could be.

10

u/Retinator99 Jul 12 '20

I wish there was an easy to update version independent of anaconda. Having to run it through another program makes it super clunky

13

u/ivosaurus Jul 12 '20

pip install spyder or you can use the pipx tool for similar but self-contained results.

Also not sure if people know about it much but miniconda is great. It's anaconda python distribution but without the 500mb installer and every scientific package known to man cluttering up your root environment by default.

Anaconda don't seem to advertise it much, seems they want newbies always grabbing the whole pile to play with at once

7

u/kodyloki Jul 12 '20

I agree, I really enjoy Spyder. I can’t easily use Jupyter notebooks at work due to running on remote machines and shared networks, etc. so Spyder is really all I use.

1

u/vectorpropio Jul 12 '20

Why don't keep using it?

1

u/Turd_Bucket Jul 12 '20

I learned R first, and use RStusio. Spyder makes sense to me, but I am not the biggest fan of Anaconda. I know you download Spyder free standing, but haven’t gotten around to it.

Didn’t install Anaconda either when I got my new PC.

-4

u/[deleted] Jul 12 '20

[removed] — view removed comment

8

u/[deleted] Jul 12 '20

On older hardware, PyCharm is like wading through molasses.

→ More replies (1)

3

u/ParanoydAndroid Jul 12 '20 edited Jul 12 '20

Pycharm is my go-to and I looooove it. But its jupyter support is god awful.

2

u/[deleted] Jul 12 '20

Agreed. VS Code doesn't hold a candle to it. At work, the code that gets committed with the most warnings almost always comes from a non-PyCharm editor.