1 00:00:00,000 --> 00:00:03,500 Okey-dokey, at this point in time, you should have Python installed already, 2 00:00:03,680 --> 00:00:08,029 and it's now time for a quick lesson on some command line 3 00:00:08,029 --> 00:00:13,210 basics. So if you are on a Mac, there's a program called 4 00:00:13,220 --> 00:00:16,030 'Terminal', and pretty much every Mac comes with this, and 5 00:00:16,040 --> 00:00:18,990 you can find it by hitting command space, and then just typing 6 00:00:19,000 --> 00:00:24,130 'terminal.app', or just 'terminal', and then go to 'Terminal' 7 00:00:24,140 --> 00:00:27,340 app. And that will open up your command line program for 8 00:00:27,350 --> 00:00:30,250 you. If you're on Windows, you'll probably have a program 9 00:00:30,250 --> 00:00:33,760 called 'cmd', or 'PowerShell', or you can download one called 10 00:00:33,760 --> 00:00:36,100 'Commander', 'Cmder', 11 00:00:36,100 --> 00:00:39,160 and that will be a command line program that you'll use for 12 00:00:39,170 --> 00:00:40,270 the rest of the course as well. 13 00:00:40,420 --> 00:00:43,990 If you're on Linux, there's a program called Bash, but there's 14 00:00:44,000 --> 00:00:46,480 also a ton of other programs out there that you can install. 15 00:00:46,600 --> 00:00:49,870 Likewise for Windows and Mac OS as well. 16 00:00:49,880 --> 00:00:52,510 So really, if you don't want to use what's already on your 17 00:00:52,520 --> 00:00:55,120 computer, and every computer will come with a command line 18 00:00:55,130 --> 00:00:58,100 program, you can download and install a different program. 19 00:00:58,400 --> 00:01:02,900 Okay, so I've just zoomed in on my terminal here so you can see what's going on. 20 00:01:02,960 --> 00:01:06,950 And for a quick little command line crash course, there's 21 00:01:06,959 --> 00:01:08,510 a few things you're going to need to know. 22 00:01:08,520 --> 00:01:10,970 You need to know how to list files in a directory. 23 00:01:10,980 --> 00:01:12,950 So on Unix based systems, 24 00:01:12,980 --> 00:01:17,520 so Linux and Mac, you can usually type 'ls -la', and it will 25 00:01:17,530 --> 00:01:19,080 show you all sorts of things in here. 26 00:01:19,090 --> 00:01:22,470 You can see I've already got a Fuller called 'Python_for_Everybody'. 27 00:01:22,970 --> 00:01:25,320 Where's the one that I want to go into? 28 00:01:25,350 --> 00:01:26,430 Let's go into 'Movies'. 29 00:01:26,700 --> 00:01:30,200 So, let's say I can see that there's a folder in there called 30 00:01:30,200 --> 00:01:31,600 'Movies' that I want to get into it. 31 00:01:31,600 --> 00:01:37,000 I can type 'cd', and then the name of the folder, and now I'm inside of it. 32 00:01:37,000 --> 00:01:40,600 And most programs will also tell you which directory you're in as well. 33 00:01:40,700 --> 00:01:43,400 A directory is a folder, by the way, if you did not know that. 34 00:01:43,400 --> 00:01:45,400 Now just going back a quick sec, 35 00:01:45,500 --> 00:01:47,390 I did the example of 'ls -la'. 36 00:01:47,400 --> 00:01:50,240 If you are on Windows, your command is going to be different. 37 00:01:50,250 --> 00:01:55,320 It's going to be 'd-i-r', 'dir', and 'dir' will show you all of your 38 00:01:55,330 --> 00:01:58,980 files and folders the same way that 'ls -la' does for me. 39 00:01:59,240 --> 00:02:03,470 So let's 'cd' into a directory called 'Movies', that's just change 40 00:02:03,480 --> 00:02:06,200 directory. You can use this on all operating systems. 41 00:02:06,210 --> 00:02:07,490 'cd' just means change 42 00:02:07,500 --> 00:02:11,789 directories. 'pwd' will show you exactly what directory you're 43 00:02:11,800 --> 00:02:13,199 in. So I'm in the 'Users' directory, 44 00:02:13,199 --> 00:02:14,370 'kalobtaulien/Movies'. 45 00:02:14,370 --> 00:02:16,740 If you're on Windows, this is going to look a little different. 46 00:02:16,740 --> 00:02:19,900 It's going to say something like 'C:\' drive, 47 00:02:19,900 --> 00:02:21,790 I can't remember exactly what it is, 48 00:02:21,850 --> 00:02:23,920 'Users', that would be 49 00:02:23,980 --> 00:02:27,940 'kalobtaulien/Movies' something along those lines. 50 00:02:27,950 --> 00:02:30,940 Anyway, that's what you'll see on Windows. And on Linux 51 00:02:30,940 --> 00:02:38,200 it might actually just look like '/home/kalobtaulien/Movies, 52 00:02:38,200 --> 00:02:39,200 I don't know, something like that. 53 00:02:39,240 --> 00:02:41,970 So that's how you see where you currently are, it's 'pwd'. 54 00:02:42,180 --> 00:02:44,820 Now let's say you wanted to make a directory, and this is 55 00:02:44,830 --> 00:02:46,950 going to be important eventually down the road. 56 00:02:47,160 --> 00:02:51,090 So if I do 'ls -la' or 'dir' on Windows, I can see that I have 57 00:02:51,100 --> 00:02:52,100 a few files in here. 58 00:02:52,120 --> 00:02:53,860 None of them are really important. 59 00:02:53,870 --> 00:02:56,650 If I wanted to make a new directory, I could do 'mkdir', 60 00:02:56,940 --> 00:03:00,180 that stands for 'Make Directory', and let's call it 'TestDir'. 61 00:03:01,800 --> 00:03:03,800 'ls -la' or 'dir' on Windows, 62 00:03:03,830 --> 00:03:07,510 and you can see that there is a new directory in here, 63 00:03:07,510 --> 00:03:11,700 and I can change directories into there, and do 'pwd'. 64 00:03:11,700 --> 00:03:14,600 [no audio] 65 00:03:14,600 --> 00:03:17,000 Now if you are in a directory, and you want to move out of 66 00:03:17,000 --> 00:03:19,900 it, you can always do 'cd ../', and that will move 67 00:03:19,900 --> 00:03:21,000 you up a directory. 68 00:03:21,000 --> 00:03:22,000 You can do it again. 69 00:03:22,300 --> 00:03:26,900 'cd ../', moves you up a directory. And if you ever wanted to move 70 00:03:26,910 --> 00:03:31,490 into multiple directories, you could do 'cd Movies', and then 71 00:03:31,500 --> 00:03:35,270 whatever the other directory is, or a subfolder, or a subdirectory. 72 00:03:35,450 --> 00:03:38,820 And for a lot of cases you can just usually type most of 73 00:03:38,830 --> 00:03:41,310 the word hit tab and it will autocomplete for you. 74 00:03:41,500 --> 00:03:43,500 So 'cd Movies/TestDir' 75 00:03:43,860 --> 00:03:49,140 I moved into two folders at the same time there. 'cd .. 76 00:03:49,150 --> 00:03:52,270 /../' will bring me out of 'TestDir', 77 00:03:52,270 --> 00:03:57,400 out of 'Movies', and back into my main location, which for me is 'Users 78 00:03:57,600 --> 00:04:01,900 /kalobtaulien'. One last one you're going to need to know is 79 00:04:01,900 --> 00:04:03,500 'python'. 'python' is a command. 80 00:04:03,590 --> 00:04:05,260 Let me clear this out as well. 81 00:04:06,500 --> 00:04:08,500 Python is a command you're going to need to run. 82 00:04:08,590 --> 00:04:11,400 And it's probably a good idea to try to figure out what version 83 00:04:11,400 --> 00:04:16,160 of Python you have right now by typing 'python -V', and 84 00:04:16,160 --> 00:04:18,899 you can see I'm using Python 3.7.2. 85 00:04:19,800 --> 00:04:24,500 You might be using Python 3.7, 3.8, 3.9, something newer. 86 00:04:24,500 --> 00:04:26,720 If you see, 87 00:04:27,200 --> 00:04:32,300 Yeah, if you see Python 2.7., something, or other, without 88 00:04:32,300 --> 00:04:33,900 having to type 'python2', 89 00:04:33,940 --> 00:04:36,820 if it just shows this in here when you run this command, 90 00:04:37,060 --> 00:04:38,590 that could be a problem. 91 00:04:38,600 --> 00:04:42,250 So for me I just need to type 'python', and it assumes Python 92 00:04:42,250 --> 00:04:45,400 3. If your computer is not assuming Python 3, you 93 00:04:45,400 --> 00:04:48,600 might have to type 'python3 -V', 94 00:04:49,000 --> 00:04:52,100 and you can actually see because I'm using multiple versions of Python, 95 00:04:52,140 --> 00:04:54,930 if I use 'python3' instead of just the word 'python', it 96 00:04:54,940 --> 00:04:56,860 uses Python 3.8. 97 00:04:57,090 --> 00:05:00,250 And again, that's just because I have multiple versions of 98 00:05:00,260 --> 00:05:01,330 Python on my computer. 99 00:05:01,580 --> 00:05:05,900 There's also another way if you have Python 3.7, you could 100 00:05:05,910 --> 00:05:08,870 do 'python3.7 -V', and it'll show you, 101 00:05:08,880 --> 00:05:11,960 and I don't even know if I have Python 3.6 on here anymore. 102 00:05:13,000 --> 00:05:16,300 Turns out I don't, but I could install with 'pyenv'. 103 00:05:16,340 --> 00:05:18,830 That's something we can talk about down the road is multiple 104 00:05:18,840 --> 00:05:24,490 versions. But the thing to take away here is if 'python -V' says 105 00:05:24,500 --> 00:05:27,890 Python 2., something or other you might want to try 106 00:05:27,900 --> 00:05:31,660 'python3 -V', and moving forward you're going to want 107 00:05:31,670 --> 00:05:35,580 to use 'python3 yourfile.py'. We'll talk about that 108 00:05:35,590 --> 00:05:38,280 again in the future lesson, but that's just something to 109 00:05:38,280 --> 00:05:40,700 be aware of on the command line as well.