From the course: CompTIA PenTest (PT0-002) Cert Prep
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
Procedures and functions
From the course: CompTIA PenTest (PT0-002) Cert Prep
Procedures and functions
- As a last topic that we want to cover, how do I write code that is reusable and is as compact as possible? New developers, script or any type of software developers, have a tendency to write line by line linear code so that you just have to go through hundreds of lines of code to figure out what happens. As you learn more about coding techniques, it's very common to take any functionality that you want to execute more than one time and put it into a code block. So you could just refer to it and say, go do that, Go do that again, go do that a third time without having to have those lines of code in your program or script over and over again. So we have two different constructs called functions and procedures that we use to do exactly that. So let's go look at some Python examples on the subtle differences between functions and procedures and why you might use them. Let's look at procedures. Here, we're going to go to easypythondocs.com and look at their entry for procedures. An easy…
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
Using scripting in pen testing12m 32s
-
(Locked)
Bash scripting basics14m 55s
-
(Locked)
Bash scripting techniques10m 11s
-
(Locked)
PowerShell scripts4m 2s
-
(Locked)
Ruby scripts6m 32s
-
(Locked)
Python scripts5m 45s
-
(Locked)
Scripting languages comparison10m 56s
-
(Locked)
Data structures, part 17m 41s
-
(Locked)
Data structures, part 28m 12s
-
(Locked)
Libraries3m 3s
-
(Locked)
Classes8m 5s
-
(Locked)
Procedures and functions5m 48s
-
(Locked)
Perl and JavaScript5m 41s
-
-