Time
2 hours 57 minutes
Difficulty
Beginner
CEU/CPE
3

Video Transcription

00:00
Hello, everyone. Welcome back. This is Lesson six of Intro the Python on Cyber Eri on Man And I'm your instructor, Joe Perry. In this video, we're gonna cover the last objective of lesson six and we're gonna learn to use the python help and dirt functions. And we're also gonna take just a second to have a look at the python documentation.
00:18
So
00:19
to do this, we're going to work in our interpreter once again. Again. We're going to die Python three of the command line
00:24
and we're gonna open a python three interpreter.
00:28
The first time we're gonna look at is help now, help. As I said, it's a function which means that it is executed by putting the parentheses after it. We're not talking. We're not talking about functions very deeply yet. We'll do that in a later video, But once you run that command, it's going to it's going to open up this new sub program. That is the help program inside of the interpreter.
00:45
And you can see the instructions there, give it the name of a module or key. We're basically any python topic,
00:51
and it will if it has information about it. It will give you that information now. It can be a little bit tricky to use at times just because, for example, things like strings, which are very important components of python
01:03
you don't actually find by writing words strings. But it will try and give you information. For example, use helps stir for help on the store class. It will try and give you information about how to search for that and for whatever You're trying to get help.
01:14
Anyway, we're gonna look at an example of this, which is just going to be the print function.
01:21
So you can see here. If you're familiar with man pages, this is gonna look pretty familiar to you.
01:25
You've got your function at the top, and then after that you've got a description of how it's used, what arguments you would give it. And then you have an actual text description, prints the values to a stream or to assist out standard out by default. Sista STD O ut is standard out. That just means printed to your screen, which, of course, we've demonstrated, even if we don't really know what functions are yet we've demonstrated what print
01:45
actually does. This is just giving us an explanation, sort of
01:48
in a verbose way with more information about arguments.
01:52
So that's what helped. Looks like you can use help again for pretty much any module key order symbol. If it has documentation, python will be able to provide it.
01:59
You leave that just by typing. Quit. Now, that's different from quitting your shell, which is done with quit with parentheses in the help documentation. You just write the word quit.
02:07
So we've learned to use help. Now we learned used a render is a tricky one to explain without a lot of knowledge of python
02:16
because it deals with the topic called name Space is not something we're not gonna spend very much time on it. All right now, other than to understand that a name space basically just means
02:24
the current environment in which you're executing code and to give you a better way of understanding that are more clear way we're gonna run dirt right now without any other arguments with any information. So this is a fresh show. We haven't really done anything in it yet. It would modify any information, and you could see that we have these, uh this list of items with these underscores around them.
02:44
Underscores, basically are an indication in Python.
02:46
Those are internal functions. They're not really for use by for the probe by the programmer or by other programs or other modules. Those are built in parts of your current name space.
02:58
Now, if you want to see what names are, how you could modify a name space, a simple example would be creating a variable. But we will call X
03:06
another variable. We will call. Why
03:10
now? Nothing's happened here because we were assigning to these variables. So even though we're in a ripple which generally reads, executes and prints, it's not wrong to print because it's sending that information to the variable instead.
03:21
But we've got X equals one y equals a. What we're gonna do now is we're gonna rerun that dirt command,
03:28
and you can see the end of the list. These two new items have been included X and Y, and those air the variables we just created, and that's what the name spaces, and that's why I wanted to address it. What you're what this is is going to show you everything that is currently defined, that you can have access to.
03:42
Additionally, if you run it with command, for example, running it against one of those variables,
03:46
not what I meant to do.
03:53
You'll see a bunch more options. These are all of the things that are defined within the number variable. So these are all of the functions, the methods that numbers have access to.
04:02
And to give an example of that, we can see x dot numerator, which is actually not a method. It's a tribute.
04:08
The numerator, of course, of one is one,
04:12
and we're gonna get out and clear that screen. That's dirt, so that's helping. That's a dirt Those functions like a set of utility functions. Not only will they become easier to understand as we go forward and videos, you're gonna find more uses for them. You could do a bunch of stuff with both of those functions. I'll give you a ton of information, often times when you're trying to run down an error. Those are the places to start
04:30
because you'll be able to figure out what's happening with
04:32
hm
04:33
the last thing I want to show you here. And I think I might still have it. Yes, have it up in my browser. The Python three documentation. This is it. Https colon forward slash forward slash docks dot python dot or GE
04:46
or those backslash and I can never remember which direction you call the slash. Either way,
04:49
Doc's not python dot or GE, and then it's the pylon. Three. That's seven dot to documentation. Specifically,
04:56
you can see here this menu you that python 3.8, which is still in debt for people who are using it ahead of time.
05:01
3635 and 27 Now, we're currently working in 36 But like I said, none of the coding we're gonna be doing in this in this part of the class or in this class, really in general is going to run into any differences between 36 and 37 So we're not gonna worry about
05:15
between now and the intermediate and advanced classes. We're gonna move on to actually using the proper python
05:20
Anyway,
05:21
that's a python help documentation. I shouldn't close that window.
05:25
Not done with it all.
05:28
That's That's the python help documentation. You could see that they have tutorials, library references, language references. In fact, this tutorial I do want to draw attention to is absolutely spectacular. It's all part of the python install. It's all part of I thought It's free to use and free to read.
05:43
I absolutely love it. And in fact, a lot of our material in this course is going to be based on information that tutorial
05:49
in the intermediate in the advance, we kind of step away from what the tutorial covers. But in this intro course, you can absolutely use that. That's one of the best supplemental resource is you can have access to.
05:59
All right, so that's the end of this video, and therefore that's the end of Lesson six in less than six. Again, we discovered we discussed the pylon syntax had to use python of command line, how to create an excuse python scripts and how to use the help and deter functions. All of those things again are going to not only make more sense, we become more relevant
06:16
with each passing video. I just wanted you to be introduced to them now,
06:19
so we're ready to roll.
06:20
Please join us
06:23
in less than seven. We're going to discussing the python data types.
06:27
As always. I'm your instructor, Joe Perry, and thank you for watching this video intruder python here on cyber eri on demand

Up Next

Intro to Python

This is an introductory course on Python for cyber security, giving students the ability to understand the basics of the language, solve problems with scripts and identify useful Python modules.

Instructed By

Instructor Profile Image
Joe Perry
Senior Technical Instructor at FireEye, Inc
Instructor