Python for the .NET developer Transcripts
Chapter: Computational notebooks
Lecture: Notebooks from PyCharm
0:00 Now if you like the idea of these notebooks
0:02 but you've become accustomed to PyCharm
0:04 and you want to stay there, it turns out
0:06 there's a really nice way to work with them in PyCharm.
0:08 Watch this.
0:10 We'll go over here, here's our domain authority
0:13 notebook we had, we open it, and look at this
0:17 it's just over here running, like so.
0:20 We have this split view.
0:22 We can view just the output like this.
0:25 We can go here, we can even rerun it.
0:27 As we'll see, you can see it in this kind of
0:29 half, half mode.
0:31 I'll hid the project, 'cause really we're just
0:33 going to focus on that here right?
0:34 And I can come over here and say
0:35 I want to run, notice I can just write
0:38 standard import statements.
0:40 But I'm going to run this, actually this is not necessary
0:44 and apparently that is not either?
0:46 Yeah, it's not, 'cause we're actually using feedparser.
0:49 So look, it already gave me some help to say
0:51 those imports were not used.
0:52 But let's run it and see what happens.
0:54 I just open and hit Alt + Enter
0:55 and it's now starting a Jupyter Notebook
0:59 right there for us.
1:00 Okay, we don't have to work with it
1:02 or do anything, you can see the server log
1:04 and how you get to it if you want
1:05 but you don't even need to go to the browser.
1:08 That part ran, and we can come down here
1:11 and we could just start making our way along
1:13 run this, run our output notice right here
1:17 get our Python bytes, and check this out.
1:18 Let's go to just this view.
1:21 We haven't done anything in the debugger in PyCharm
1:24 I don't believe, but the debugger is killer
1:26 and look at this, as you go through it
1:28 you hit these breakpoints and stuff
1:29 it actually shows the variables, and then their value.
1:33 And if the values change, these actually change color
1:37 as non-select, this is not text that I can select
1:39 it's just a visualization as I go through.
1:42 I could just run everything.
1:45 We'll go down, you can see all the data coming out.
1:47 Is that cool or what?
1:48 You see all the pieces, right?
1:49 You can already see what the values are there.
1:53 And then let's go back and look at the actual output
1:55 there it is. Looks a little weird in dark mode
1:58 but nonetheless, I really like this way.
2:00 You can even upload it to their hosted cloud thing
2:03 called Datalore, is what I think that is.
2:05 It gives you some help on all the things you can do
2:07 insert new cells, but notice it's using
2:11 this editor that we can just type through.
2:14 So if you prefer more of a code editor style
2:17 you can do that right in here and just seamlessly
2:19 move through, Ctrl + Enter still runs everything
2:22 and so on.
2:23 So if you're a fan of PyCharm and you want to stay in it
2:25 this is pretty cool.
2:26 Look, it's using the right environment
2:28 it's running on the server, all kinds of cool stuff.