© Distribution of this video is restricted by its owner
00:05 | our meeting is being recorded. So on. We're gonna post this |
|
|
00:12 | , um, to the class later . So if you have any any |
|
|
00:18 | of question, you'd rather be more public than just wait for the end |
|
|
00:22 | this meeting and you can ask her the recording time anywhere. Um, |
|
|
00:30 | to the second last class official for semester. I hope you're all doing |
|
|
00:36 | and hopefully getting a little bit adjusted the new life. And we're trying |
|
|
00:42 | do our best toe finish this course hopefully you learn most of the |
|
|
00:50 | So before we get started on the part a few announcements which I've already |
|
|
00:57 | on the mail on the message world as an announcement on blackboard but really |
|
|
01:09 | we did post midterm. The second from essentially it is the same one |
|
|
01:15 | last year. So you did not a second midterm this year for practical |
|
|
01:21 | . But the style off these midterms the finals is generally very similar, |
|
|
01:27 | you should try it out. The yourself and very soon will boast a |
|
|
01:35 | so you can grab yourself. And you have questions or concerns about |
|
|
01:39 | Let us know. But it's really your practice. And since I think |
|
|
01:46 | know 70% of the content and for final, maybe not 50 60 something |
|
|
01:52 | covered for the midterm, too. that should give you a handle on |
|
|
01:58 | you stand. Okay? As we're on, the basic rules up that |
|
|
02:05 | you have an easy question, try , put it on chat, and |
|
|
02:10 | we'll get to it. Um, you have something quick to say, |
|
|
02:16 | can open your microphone and just say . Andi, if you, |
|
|
02:22 | what is this feature? Raise your . If you want to talk a |
|
|
02:27 | and waiting for your turn, just click that raise your hand and we'll |
|
|
02:33 | out and you're welcome to keep your on or not. That's up to |
|
|
02:38 | . Okay? Eso back to We just posted the midterm. It's |
|
|
02:44 | for self assessment, trying to use like that and give you a pretty |
|
|
02:49 | handle. Where you stand final is soon. It's in two weeks. |
|
|
02:56 | also just to realize and yes, knew it, but so you probably |
|
|
03:01 | a lot of questions about the Um, I don't have all the |
|
|
03:08 | yet, but I will have very , but basically is gonna be an |
|
|
03:13 | off course and is going to be blackboard. Some details are still being |
|
|
03:20 | out. It is going to be comprehensive. A certain include everything with |
|
|
03:29 | emphasis on the, um on the after the first midterm. And the |
|
|
03:37 | of the content really early in the will not be included. We |
|
|
03:42 | uh, send that out soon. . Essentially all the fight on that |
|
|
03:50 | have learned exercises that will you have control structures if the house while for |
|
|
03:59 | well as some data structure, strength and dictionaries that air coming up eso |
|
|
04:07 | probably stomach. You're wondering. Is gonna be open book, closed |
|
|
04:10 | And of course, we all understand difficulty off having a closed book exam |
|
|
04:16 | the, uh, in an online . However, the only thing I |
|
|
04:22 | tell you is that it may not that much. Even if you have |
|
|
04:28 | open book. There won't be enough for you to goto the you |
|
|
04:33 | the core content off. What it read up and then tried once or |
|
|
04:38 | question. So you have to be . And my bastard wise is there |
|
|
04:43 | a cheat sheet that we have a You can make your own cheap shit |
|
|
04:48 | quickly summarizes the syntax and the basics things and refer to that it's gonna |
|
|
04:56 | employed few during the exam to refer content is gonna be eso think off |
|
|
05:03 | . It is kind of a closed , But you can have a little |
|
|
05:06 | shoot or you're not with you. when unexamined, close, open book |
|
|
05:13 | be a problem because people spend so time trying to refer to things they |
|
|
05:18 | think can actually do more worldly than word out. If it was open |
|
|
05:22 | so short on it being closed, with some notes on your side. |
|
|
05:28 | in a couple of days, the rules will be clear. Um, |
|
|
05:34 | in terms of content for the we're gonna cover files this week, |
|
|
05:39 | there's one topic left, which is reading assignment for this week. That |
|
|
05:43 | dictionaries, and that's as much as content is going to be. |
|
|
05:49 | we're going Thio release your last assignment week. Sooner than usual, this |
|
|
05:56 | assignment will talk about it. It's very hard is just thinking of things |
|
|
06:01 | differently. And that will be And we'll find some time next week |
|
|
06:08 | toe talk about the final and the and so on. Um, any |
|
|
06:14 | on the's logistical aspects? Well, not, we'll get back. If |
|
|
06:26 | questions come to your mind during the today, just hang on to them |
|
|
06:32 | we will address them at the end the lecture to So today's talk is |
|
|
06:40 | be two pods. Um, I'm to cover the first part. That's |
|
|
06:47 | files. And but you're the ts cover the second part. That's about |
|
|
06:53 | by charm. Um, let me get to the lecture and then |
|
|
07:02 | you understand better why? We're doing this way. Okay, so I'm |
|
|
07:07 | Thio, get Thio some slides and screen. Okay. All right. |
|
|
08:02 | . I lost the chat window, . Okay, so there's a question |
|
|
08:14 | the next assignment, but by chump online book will get thio. |
|
|
08:22 | eso The short answer is that we would like you to do it on |
|
|
08:30 | . Um, but if you you do it in the book and the |
|
|
08:37 | lessen the luxury to be more clear we're doing that. Any other |
|
|
08:50 | Okay, Uh, keep losing the window, Professor. I can follow |
|
|
09:04 | . They're gonna live in a Just let me just one more |
|
|
09:08 | And that sounds good. So why don't you tell me if |
|
|
09:11 | uh, anything we need to but, uh okay, so |
|
|
09:26 | So, back to files. Let do one more thing. The different |
|
|
09:33 | from the restaurant's. OK, so are the topics we covered in terms |
|
|
09:39 | general announcements and information. We're We're gonna first part is gonna be |
|
|
09:46 | files in general. And the second is gonna be about, um, |
|
|
09:53 | charm and we'll cover the files, then then we'll talk about why we're |
|
|
10:01 | this. Okay, So, to topic, finally, so far, |
|
|
10:08 | you've done in this class, the import has bean from the user on |
|
|
10:15 | writing has bean to the console. ? So you read something which is |
|
|
10:26 | provided by the user, and then right. Um however, that is |
|
|
10:33 | as a learning tool in the real as you can imagine, what real |
|
|
10:38 | governments manipulate fires. What do you in the real world to deal with |
|
|
10:43 | ? Uh, should not. And of that is in a file |
|
|
10:49 | People don't remember those stuff. Don't those stuff and that that just lives |
|
|
10:54 | file. So, basically, in life, just about all computer programs |
|
|
11:02 | take input from files the program as coming in because audio radio would not |
|
|
11:13 | the planet output either files or it some action, right? Action might |
|
|
11:21 | something like turning on or off your star, your computer even and things |
|
|
11:30 | that. So build world at the that the program does is really look |
|
|
11:36 | file analyzed that I manipulate data. with the results back in the |
|
|
11:42 | our our takes, um, actual action. So we need to take |
|
|
11:48 | close look at files because they're really now, with all kind of familiar |
|
|
11:54 | files, we see them on our s so we know where the file |
|
|
11:59 | . So it's on M marathon before can do anything with a file. |
|
|
12:06 | must for planet. Uh, open with its name. And once you |
|
|
12:16 | a file, get a qualified Yeah. So a fire manipulation |
|
|
12:27 | It starts with something like this. Because open my five text or whatever |
|
|
12:36 | is. So this is a file you are familiar with. Open is |
|
|
12:40 | standard called and And that and the all future reference toe fire data is |
|
|
12:48 | five handle you don't have Everything is and which can be any variable. |
|
|
12:54 | doesn't have to be called five. that Z a demonic you could actually |
|
|
13:00 | on. And then all the daughter be referred to as a sex. |
|
|
13:11 | , so opening fires and buy Um, we just saw this statement |
|
|
13:28 | the previous slide. Five hunger equals file name and then read the basic |
|
|
13:35 | to open a file called Solomon. it for reading. That's probably the |
|
|
13:41 | common use off the fire. the file opening version off opening that |
|
|
13:50 | was the most. Of course, has to write these files to, |
|
|
13:55 | you have another call call which looks the same. But instead of read |
|
|
14:01 | have w here. So this one saying I'm opening a file all file |
|
|
14:06 | and use it for writing for reading for writing. And generally you'll do |
|
|
14:12 | of those. And when you're done the program, you're done with your |
|
|
14:16 | . You're you're done with your It's good practice to cross the |
|
|
14:21 | And, um, why close Uh, so another person cannot use |
|
|
14:28 | file hunting. You close it. it's sort of when you're opening a |
|
|
14:33 | for reading or writing your kind mocking it, so eso unlock it |
|
|
14:44 | closing it, and you're done the more time Variable file Handle Raptors to |
|
|
14:51 | content. Once you make this you only have to deal with the |
|
|
14:55 | file handle for for the and in program. So way saw modes in |
|
|
15:10 | can be opened, the lead mode the right mode. There is also |
|
|
15:16 | mode, and, uh, the not don't know, worry to mind |
|
|
15:21 | you don't remember it. That's but it slipped enough so for reading |
|
|
15:27 | what can you do with the So let's just not look at the |
|
|
15:32 | modes you can read a file you read from a file. You can |
|
|
15:39 | from a file, write to a , and then you can. All |
|
|
15:43 | . All right. Means, what you do when someone asks you to |
|
|
15:48 | to a file on Duh. The . The file already has stuff. |
|
|
15:55 | there are rules on what you can , and and the other one |
|
|
16:00 | What do you do if someone You are to read a writer |
|
|
16:07 | Are you ask? Fight on to a writer file on the fight doesn't |
|
|
16:12 | . Okay, so those are the to think about in terms of the |
|
|
16:17 | off the read, write and end . So when you're in read, |
|
|
16:25 | , you have are in your open . Can you eat the pile? |
|
|
16:30 | course you can. Can you write fire? No. Can you? |
|
|
16:34 | . No. Create missing fire. what does it mean? If you |
|
|
16:40 | to read a file and that file not exist, what should happen is |
|
|
16:50 | , way would, uh, There's you can do, right? The |
|
|
16:56 | is saying read some file. That does not exist, so there's nothing |
|
|
17:01 | can dio you will just, so a narrow right. There's nothing |
|
|
17:09 | to do it. So this would an error. If it happens, |
|
|
17:14 | . So now let's get through a right in the file. Right. |
|
|
17:24 | you're trying to read a file, not gonna work, you open the |
|
|
17:29 | to right not to read, so try to read it. It is |
|
|
17:33 | throwing error. You can simultaneously be and writing from the same file, |
|
|
17:39 | ? The file. Of course we . That's the whole point off the |
|
|
17:43 | operation. Can you? All Yes. So if there is already |
|
|
17:49 | file, you open it to try , you will lose the content that's |
|
|
17:54 | there in the file. And um, you start a flash, |
|
|
18:01 | will start. You start essentially, becomes an empty five. And whatever |
|
|
18:08 | write at some that point on is would be on the fire. Create |
|
|
18:13 | fire. So this is interesting. you know, you say I want |
|
|
18:17 | right to the fire. All, um, you back next and there |
|
|
18:24 | no file called Knew that text. in this case, since writing is |
|
|
18:34 | something in this scenario. So you actually create a file. You would |
|
|
18:41 | a new file calling you that tax start writing into it. So if |
|
|
18:46 | give it a final name, if give a program to find them too |
|
|
18:49 | toe the file doesn't exist, it come up with a new file and |
|
|
18:53 | that happen. Yes. So that's . And the final one is, |
|
|
19:02 | the end? The idea is that we saw is essentially cleaning out the |
|
|
19:09 | and starting to write again. It sense for us to have an operation |
|
|
19:14 | you add existing files. So in , the rules to each other, |
|
|
19:23 | , answer is notary. We're Yes. All right. No, |
|
|
19:31 | means you're not gonna all right, gonna just gonna add at the end |
|
|
19:36 | It's okay to have something in the of the file. And, |
|
|
19:41 | and also, if the file is , it will just create a file |
|
|
19:47 | right basically arrived and a friend of same set. If there is already |
|
|
19:54 | in the file that it's all written with, uh, happened with with |
|
|
20:03 | . And you just added to the in the thing. Let me just |
|
|
20:09 | here for a second. Just we this. Yeah. Yeah. |
|
|
21:15 | I have my check Window. Nine . Anybody has a question? Any |
|
|
21:22 | so far on? Well, more than Okay, Okay, so now |
|
|
21:55 | question is, where are these Right. You say open something. |
|
|
22:00 | does it exist? How do you it? Where do you What names |
|
|
22:05 | you put in? If you want read or write a file? Of |
|
|
22:09 | , even now that these files exist your computer, what does it mean |
|
|
22:14 | say that exist on your computer? , that usually means the people. |
|
|
22:20 | means your hard drive or it can flash drive. This is all of |
|
|
22:24 | computers. Storage, stable storage, the memory, but started, which |
|
|
22:31 | usually a hard drive with a flash . And within that the hierarchically organized |
|
|
22:36 | folders and directories. So when you thio, give off, I'll I |
|
|
22:42 | for reading. You need to specify in the computer that is. Suppose |
|
|
22:48 | looking for a file called constitution dot . Now, you can't just open |
|
|
22:56 | file constitution that text because there might 55 on your computer that have the |
|
|
23:02 | name. What is like on a to dio? So what? You |
|
|
23:07 | todo something like before, Uh, name off the fire. And there |
|
|
23:14 | a Siri users just for industrial That tax that's one with from beginning |
|
|
23:20 | friends to get the whole file whether it's on a Windows machine. |
|
|
23:25 | you right click on the file and properties, you'll get this cat like |
|
|
23:31 | . And, uh, you can give a delicate part. What? |
|
|
23:38 | that means is that this is mistakes . But I suppose I'm already in |
|
|
23:47 | same folder. My program is running this part off the bat, that |
|
|
23:54 | my program is running from my desktop that iss I can only say, |
|
|
24:00 | for file constitution, that tax, within the failure that I'm working |
|
|
24:06 | there is only one that can be one constitution that tax. So it |
|
|
24:10 | That's called a little file, from where you are, this is |
|
|
24:14 | path is just, uh you this concision and that say, if |
|
|
24:18 | will, you have that would be need to adjust your constitution that we |
|
|
24:24 | . Um, if you were she . If you are in this spoiler |
|
|
24:35 | to run a program from this then you would need to give this |
|
|
24:40 | bus stop flash constitution that TSC so can have a full pat. Or |
|
|
24:44 | can have what's called a relative path to the fire some beetles, |
|
|
24:51 | Sandusky vehicles, for example. You'll that, uh, in your |
|
|
25:00 | when you refinement, you use this off slashed on dawn, the best |
|
|
25:07 | when you try to look at it the school s. You may see |
|
|
25:11 | like this. Those little things you tow work out. But the basic |
|
|
25:16 | is like this. So another way think off it is a five structure |
|
|
25:24 | the whole your hard drive. Not you should be my convention, The |
|
|
25:32 | our directory on Windows machines is called Seas. It's the C drive, |
|
|
25:37 | within that there's a whole bunch of , and one of those holders is |
|
|
25:44 | . Others may be on the APS and things like that, And within |
|
|
25:50 | Jesus folders, there might be a bunch of man's John Mary and this |
|
|
26:00 | subdirectory. And within that there is subdirectories. But there is one called |
|
|
26:09 | . And within that stop, that , uh, um the file that |
|
|
26:18 | send constitution that Texas. So there's all over the place. All these |
|
|
26:25 | , subdirectories have their files. And , what we have to specify is |
|
|
26:33 | how do we get to this from beginning? So this fact here is |
|
|
26:39 | and users and just file then desktop then call. So that is the |
|
|
26:46 | . That is what has to be here for the computer to Mom. |
|
|
26:52 | to look for the file that your are asking for now, in the |
|
|
26:57 | half of this lecture and a jury gonna use the actually demo some of |
|
|
27:04 | in the context off John. So any questions at this point? |
|
|
27:17 | but I can see chap window. can't see anybody. It is in |
|
|
27:21 | hand right now. So site something you have a question. Okay. |
|
|
27:34 | far we saw that you can open file a certain way, and, |
|
|
27:39 | um, then you gotta file But then what do you do with |
|
|
27:44 | ? Right, So we've already seen with a fine handle. You could |
|
|
27:49 | this file and we want to eat , uh, even and read |
|
|
27:55 | So the simplest way off leading a is affect, not read. So |
|
|
28:03 | the content equal to file handle, is like think of final handle as |
|
|
28:08 | name off the file inside your So fine handle that read. And |
|
|
28:14 | this point, content will will have strange which is the entire file. |
|
|
28:22 | it could be 10 character, 100 . It could be, you |
|
|
28:25 | 10,000 characters. It could be a book, just a strange. And |
|
|
28:30 | you try to print it, we'll just get the whole thing painted |
|
|
28:35 | a string, and after that, should close it. Now you're wondering |
|
|
28:41 | can let the whole book be a Essentially, the, uh, you're |
|
|
28:49 | one line to the next is itself character, the which is called new |
|
|
28:54 | . So if you have a book 100 pages off 1000 lines, you |
|
|
29:01 | something like that. Bind one off content and then you have this new |
|
|
29:10 | character. It's not bigger than Um, highlighting it and then you'll |
|
|
29:14 | line to and then you'll have the . But this is also a |
|
|
29:19 | so you can keep going down to three. So the whole thing here |
|
|
29:25 | just one strength as a data And this, uh, will get |
|
|
29:31 | the whole string when you plant it still see lines because you're printing program |
|
|
29:37 | interact at these new lines and Hey, I need to put a |
|
|
29:41 | right here. Make sense. Any ? So far? All right, |
|
|
29:54 | this is one way the thing to is fx dot reid is one way |
|
|
30:00 | read a file. There are some ways. So you have this |
|
|
30:07 | This part is the same. This is the same. Uh, |
|
|
30:11 | instead of read, we have dark lines. Okay, So what this |
|
|
30:19 | is, uh, on it reads file as a list off strength. |
|
|
30:26 | previous operation ratted as a single strength each representing one line in the |
|
|
30:32 | Remember, we said that the way works is its line one and new |
|
|
30:40 | line, too. New line. three lines. 23 for all. |
|
|
30:52 | by new lines. when you reuse lines, then it creates a |
|
|
31:00 | Okay. And the first element of list is a string line, One |
|
|
31:05 | element of the string line to that of the string Line three and the |
|
|
31:10 | element of the string Line four and on. So it gives us a |
|
|
31:16 | off strength. So if you wanted print it, we would say something |
|
|
31:20 | this is the best way to blanket airline in lines lines is now, |
|
|
31:26 | not a strength, as is the previously. And you can print everything |
|
|
31:32 | one line at a time. And have complete control. For example, |
|
|
31:37 | this strange that you want Thio relying us. Um, I don't |
|
|
31:43 | Um, I or something. Then will have every line high at the |
|
|
31:50 | of it so you can find the anyway. You get the same |
|
|
31:54 | Each line is separate strength in a . Okay, um, there is |
|
|
32:04 | more way off reading the file, is read line. So previously in |
|
|
32:13 | attention in the previous one, it read lines looked like this. And |
|
|
32:19 | one is really drying. They look similar, but the difference is very |
|
|
32:25 | . Or with the red line, will read one line at it. |
|
|
32:32 | if you what's the line? One 2 500 that we'd line line miracles |
|
|
32:37 | find online physical them as your asses expect? If you're program had a |
|
|
32:46 | than new lines line and new line , then new line, then time |
|
|
32:57 | would be the first one. Line would be the second one. Line |
|
|
33:00 | would be the third one. So get one line at a time. |
|
|
33:03 | can keep reading. Now think for second. Suppose you wanted to read |
|
|
33:10 | entire file in this faction? Of . Uh, first of all, |
|
|
33:16 | don't know how long the file and the second is you do |
|
|
33:20 | um, I want to be The file is 1000 lines. You |
|
|
33:25 | want to be writing the statement lineman to line three so you can read |
|
|
33:30 | a file until the end with a loop. So the goal here is |
|
|
33:39 | you want to read the file line line after line after line and you |
|
|
33:44 | to stop when the file ends so the tricky thing here is How do |
|
|
33:48 | know that while has ended? So is what you do. Line equals |
|
|
33:58 | lines. This is gonna give you first line and then wild lines. |
|
|
34:06 | this may be a little country and , but over here, this will |
|
|
34:12 | if it is anything but empty. why line is true? As long |
|
|
34:23 | the valuable line has anything in then you see a print line. |
|
|
34:27 | you say lying equals read line So it will go back. Read |
|
|
34:34 | to go back here. Need line . Go back here and so |
|
|
34:39 | Finally reached the end of the Okay, When you reach the end |
|
|
34:45 | the file line equals f h dot line return an empty, empty |
|
|
34:53 | There'll be nothing. And when that is empty, this is treated |
|
|
35:01 | false. So why line will be when the string is empty and therefore |
|
|
35:08 | white luke will and you'll close the . Okay. Um right. So |
|
|
35:20 | all the, uh, items in wilds that read a few things that |
|
|
35:29 | is in trouble when you're using the . If the file doesn't exist, |
|
|
35:35 | the final may exist. Your fact not correct. This happens a lot |
|
|
35:39 | , especially when we knew and I through an error. So if you |
|
|
35:46 | a crazy error when you're trying to a file, then most likely reason |
|
|
35:51 | that it cannot find it. Because you fight the name incorrectly or the |
|
|
35:57 | incorrectly. It has to be that to extracting where the violence of the |
|
|
36:03 | , um remember, by default, contents of the file is always that |
|
|
36:08 | a strength. Now the file itself be anything, right. So the |
|
|
36:14 | could be a cable, you C a C comma separated. It's |
|
|
36:20 | a table of things, maybe from or something. But those wagon as |
|
|
36:28 | string. So you need to do conversion, so it could be a |
|
|
36:33 | know, a whole bunch of integers the file there will be read as |
|
|
36:36 | strength, and then you need to the broadcasting whatever is needed to get |
|
|
36:42 | act of information you want. But into the file and coming out of |
|
|
36:46 | file, everything is just a strange , remember to close the file. |
|
|
36:53 | you're done in your program, you be, you know, writing a |
|
|
36:59 | and then maybe wanting to read it . If you're writing a file, |
|
|
37:03 | close it. Then you'll get Arabs you try to read it. So |
|
|
37:08 | good habit. Close the file once are done and better than we have |
|
|
37:14 | about. Yeah, text file. everything and most of what goes on |
|
|
37:21 | is by Khan is as a text , I think, for the for |
|
|
37:25 | purpose of the scores on Lee, , islands that we will be looking |
|
|
37:30 | this textiles, which is the that's anything technique converted to a tax |
|
|
37:34 | So that's not really a limitation, saying that everything is that as a |
|
|
37:38 | , everything is written as a strength not not a significant limitations on what |
|
|
37:43 | can prove. It just means that need to provide conversion before yes, |
|
|
37:50 | right name or after reading as Yeah, any questions on read |
|
|
38:04 | just a little bit more than on other up. We can do |
|
|
38:09 | At least the one that we would will be writing to a file. |
|
|
38:14 | is actually simpler than the reading in of the diversity that's available, |
|
|
38:23 | to write a gator. So we the fire, and the difference is |
|
|
38:31 | the open statement is the same, instead, off are you have w |
|
|
38:36 | right? Then we use the right . Through what data on the |
|
|
38:43 | So the only market we're gonna use simply right. And here is a |
|
|
38:54 | stand. One thing you should close file now. The string is simply |
|
|
38:59 | to the end of the file Okay, So s so it's very |
|
|
39:04 | . You just keep writing and the keeps getting longer and longer. So |
|
|
39:07 | write your first right is here. comes right after that. It comes |
|
|
39:13 | that, and so on. Another is one more time support you |
|
|
39:19 | You want toe right lines into a , right? You may even have |
|
|
39:26 | table and you want to write one at the time. It's your responsibility |
|
|
39:31 | communicate that you get a its Good on your line. You like |
|
|
39:39 | new line and so that the person will know when the line starts |
|
|
39:45 | for example, like percentage long as leading program knows that the pieces that |
|
|
39:53 | writing are separated by that character. another program to get it. But |
|
|
40:00 | , as far as my time is , the right is just filing one |
|
|
40:04 | after another. And the elephant. have just one man strength. |
|
|
40:13 | so there were things to worry While writing a file already exists, |
|
|
40:22 | will be really So you have to careful that there was something important. |
|
|
40:29 | by mistake, you put that file in the right at file is gone |
|
|
40:34 | , uh, one more time. it doesn't, it will be |
|
|
40:39 | So if you made a typo, meaning toe. Actually, your |
|
|
40:45 | All right. A certain file, you give a different name on the |
|
|
40:50 | file will be created. So you make it. I think Miss Take |
|
|
40:54 | the writing file them. If you a mistake, the file will be |
|
|
40:59 | while name you give it. So you are beginning to give it a |
|
|
41:03 | name and give it a wrong name You wanted to give it constitution and |
|
|
41:12 | mistake you voted the work asi Constitution you think everything will work beautifully that |
|
|
41:20 | day you'll be looking for this and then we're nothing there because what |
|
|
41:25 | type for us with the title with small C and that would be the |
|
|
41:29 | that would exist. So we covered already. The second point, the |
|
|
41:35 | method takes on the strings. That . So you it's your responsibility as |
|
|
41:40 | programmer to make sure that if you a bunch of anything, it's converted |
|
|
41:44 | a string before it. Zits And one more time. It's a |
|
|
41:50 | practice toe. Right. Um um , close the fire. Okay, |
|
|
41:59 | , in some way for this section the talk is, uh, for |
|
|
42:04 | right, um, you know, have a stranger's added to the end |
|
|
42:11 | the fire. Does the right operation and returns a strength? The whole |
|
|
42:18 | is return has a strength. Right . That's added to the end. |
|
|
42:24 | . The whole file is returned as strength read line. The whole fire |
|
|
42:35 | read? Sorry. This will lead . I'm sorry and read lines. |
|
|
42:42 | will get one line returned. So, uh, that's that's actually |
|
|
42:54 | content of this part of the lecture , uh, transition to the next |
|
|
43:00 | . That any questions so far, get to my charm and everything in |
|
|
43:05 | a minute. Any questions on the leader? Right? Operations either diapered |
|
|
43:13 | speak up. Yeah. Okay. if any questions come to mind, |
|
|
43:27 | can keep typing them. So I'm start, uh, you know, |
|
|
43:33 | on eso before we get to the . So so far in this |
|
|
43:38 | you use the simple, uh, simple pipe on interferes in their own |
|
|
43:46 | . Okay, so one off the of that is that it is not |
|
|
43:52 | good way to work with files. because in that interface you can work |
|
|
43:58 | files that are in the room And but you cannot write your own |
|
|
44:03 | with their own fire. And it of makes sense, because if this |
|
|
44:06 | just, uh, little books with with them, you know, with |
|
|
44:13 | examples and some bulls to help you , And also we did not want |
|
|
44:18 | dio get into We did not insist you get into a serious programming environment |
|
|
44:27 | you have some handle on the So if you're not trying to solve |
|
|
44:31 | problems at the same time. So this point it would be good familiar |
|
|
44:42 | the environment. And we suggest fight . There's others that if you're comfortable |
|
|
44:47 | something else, that's fine, So and in future, you will |
|
|
44:53 | have access to the book that you . Nobody would do serious. They're |
|
|
44:57 | in the book. The Fight John something that professional program has also used |
|
|
45:02 | their reports. Okay, so way really like you to get comfortable with |
|
|
45:09 | jam and on Bond, be able write programs and by charm and so |
|
|
45:18 | . It's a much nicer environment than book provides. Nothing against the |
|
|
45:23 | I think it's wonderful off its but, um, so what? |
|
|
45:29 | decided since normally we insist that this is done on by John because for |
|
|
45:38 | these reasons, whether because off along sort of dislocation this year we're going |
|
|
45:47 | cover by Chang, you really should by John, However, for the |
|
|
45:53 | will develop A If you somehow have with my charm, you can still |
|
|
45:59 | in the book, but we will more fun doing it invites him that |
|
|
46:06 | um if you need the final submission be done on the on the |
|
|
46:12 | So I'm going to actually get back other mud and stop sharing. |
|
|
46:26 | Yes. All right. So, so So that's that's the thing. |
|
|
46:35 | we really like you, Thio go pie champ. It'll be really |
|
|
46:40 | But just to get your points for assignment, you don't absolutely have |
|
|
46:46 | And the way we manage that is , like, a few fires in |
|
|
46:50 | book, and we'll just develop, , developed a fine man so that |
|
|
46:58 | can do the basic staying and things those files, so you don't need |
|
|
47:01 | absolutely have thio have to do So the assignment has three questions. |
|
|
47:08 | third question does require my chum, the third question is the practice |
|
|
47:14 | So there is No, it's not essential. Any questions so far? |
|
|
47:38 | . All right, So why don't what we're gonna do the rest of |
|
|
47:43 | way is that the jury is gonna give a short on how to install |
|
|
47:50 | charm, and he's also going to you a little bit more on how |
|
|
47:55 | look for files And how you are of work with the world environment. |
|
|
48:02 | world in this case being your If you had the input files on |
|
|
48:06 | laptop, the laptop, how would do it? Um, so that |
|
|
48:11 | you can get started. Then? the meantime, if somebody thinks off |
|
|
48:14 | questions, then go ahead and like and let's pause for a minute, |
|
|
48:20 | then radio will get started. You can start screen sharing whatever you |
|
|
48:40 | to set up. Okay, So I I don't see that getting |
|
|
48:48 | right now because I'm sharing the my . Stop right now. Okay, |
|
|
48:53 | hang on. Uh, yeah. just give it just falls for one |
|
|
48:59 | , we can see it, and keep I am the check window. |
|
|
49:03 | . Yes. Yes. Right. I guess there's no more questions so |
|
|
50:46 | can start with starting 500 by It eso Can you hear me? |
|
|
51:03 | . Okay, so I guess everyone downloaded the fightem Futural. Pdf we |
|
|
51:10 | uploaded in the schedule section on basically . Least every step you need to |
|
|
51:15 | , but I'm going toe, show a demonstration off the thing. So |
|
|
51:20 | , first we need to download the on. This is the link we |
|
|
51:25 | shared on the period on if you there, you'll see that download fight |
|
|
51:29 | . But in here, if you here if you do a lot of |
|
|
51:32 | , select your operating system and But if you're not sure, you |
|
|
51:36 | stick click on the, um, and then see, for example, |
|
|
51:41 | 22 bit versus 64 bit as we in the pdf different kind of architect |
|
|
51:48 | are protections so you can choose depending your system. Then once you click |
|
|
51:53 | this thing, it will start And I have already that thing |
|
|
51:57 | Onda, let's start from there. example, this McDonald for where my |
|
|
52:02 | pie fight on is downloaded. So is the 64 billion. This started |
|
|
52:07 | bit. I download a vote, my system is 60 48 So I'm |
|
|
52:10 | to click on this thing. It'll here now. The thing is, |
|
|
52:16 | very important thing is like you have . You have to click on this |
|
|
52:20 | like Air Titan, two part disability find your fight on program once you |
|
|
52:27 | it from Pai Chang. This stuff very important on demand. You can |
|
|
52:34 | . Install out that directly install your item to that folder specified. But |
|
|
52:40 | have to do about the entire So right now I'm going to use |
|
|
52:44 | on. Then I slept next because want to set the fighters part toe |
|
|
52:49 | location, not the default one. I'm going to choose a different location |
|
|
52:53 | my folder. I have a nice thio Four or five done. |
|
|
53:03 | Uh, so I have to remember place, like e applications by |
|
|
53:08 | 38. So I have to remember place because in from pica, mind |
|
|
53:12 | the system doesn't automatically finds my vital , I have to mention it. |
|
|
53:16 | if you use custom menstruation or the one year to remember the path where |
|
|
53:21 | by item was installed, this is location off your vital installations. So |
|
|
53:28 | , you wanna be pause? A is there s Oh, there's, |
|
|
53:33 | is there anybody who you can try download now? Anybody who is not |
|
|
53:40 | to download what is the site to Pleasure. It's so isn't in, |
|
|
53:51 | , Yeah. So why don't we pause for a second? Somebody said |
|
|
53:56 | had trouble downloading. Uh, let try. He's talking about Python, |
|
|
54:02 | I'm not working on by John right , so let's download python first. |
|
|
54:06 | we can go. We can see e I just wanna make sure |
|
|
54:11 | uh, so I just browse the minutes back. This is a pie |
|
|
54:15 | website, and it's working. Everyone see. Okay, uh, this |
|
|
54:27 | . Yeah. So, just one time. What was the fight on |
|
|
54:31 | again? I just wanna, um , so we can't cut and |
|
|
54:37 | So we have toe, uh s , this is a fight, |
|
|
54:47 | Okay, so there's a question. the bajan No, the question website |
|
|
54:52 | , uh, fine. So there's question. Is the anaconda package |
|
|
54:58 | Yes, it is. Okay, we're going to follow simpler ways. |
|
|
55:02 | , if someone, if somebody has conduct, do we care? |
|
|
55:09 | Everything is fine. Yeah. in the context, you know, |
|
|
55:13 | various ways of doing it, and of you already may have anaconda |
|
|
55:18 | And if you have high jump up running, that's all. It doesn't |
|
|
55:23 | . how you got it. So there's an alternate way, that's |
|
|
55:26 | If you don't have any other way by the way, the slides that |
|
|
55:34 | send that also send on on backwards you can see from there. So |
|
|
55:41 | answer is yes. And a condom find. Basically, if you're starting |
|
|
55:46 | scratch, this is one set of . Okay. Okay. So now |
|
|
55:54 | hitting the install on. He's going install my library, the python libraries |
|
|
55:59 | my system. This was for a . It's hard to read, but |
|
|
56:11 | have this recorded and kiss. Somebody to go back to it. |
|
|
56:39 | The city was successful, and we're it installing, uh, fightin on |
|
|
56:45 | next step would be will be going install the fight jump and of I |
|
|
56:53 | downloaded the pageant from this jet printer download. And I have chosen that |
|
|
56:59 | version because it is free, and sufficient for us or dust on. |
|
|
57:05 | , the download location is here, I'm going to start by German |
|
|
57:13 | Yeah, studies step forward in this on next. So whatever the decision |
|
|
57:29 | a way to give us fine then I'm going toe select these |
|
|
57:40 | This is optional Like you can do or not. That's fine. The |
|
|
58:55 | opinion searching is done. I'm going flip around Pigeon community Edition, This |
|
|
58:59 | box And then I clicked. Finished by John will start and the last |
|
|
59:08 | to import something. I don't have going for on. And so there |
|
|
59:14 | be some other two steps interview because had five families told before in much |
|
|
59:18 | same thing. So I didn't ask this time, but I have shared |
|
|
59:22 | in the pdf. It will show something like some data sharing and privacy |
|
|
59:31 | . Something like this you can select you going to these options that you |
|
|
59:37 | it. You want to share data something like that? They need to |
|
|
59:40 | to this fine where I am right . So I'm going thio, use |
|
|
59:44 | light more so you I color things you can dependent indicator also So |
|
|
59:50 | keep remaining and set defaults and I'm to start fighting now. So then |
|
|
60:01 | click on create new project. So basically sucks me Thio the location for |
|
|
60:09 | new project and everything so you can change from here. Whatever you |
|
|
60:15 | Location, for example, we can like farmers that they should go to |
|
|
60:18 | old issue. There's a file Let's see, Dr. Then you |
|
|
60:22 | see my user name and everything. maybe I'm going to choose a different |
|
|
60:27 | believed And my workspace, then by Fuller. And then I'm going to |
|
|
60:31 | it for the program. For this , uh, hello, wild |
|
|
60:36 | I don't think this is a very problem. I'm going to show you |
|
|
60:39 | now. Anything like the virtual New virtual. Remember using this |
|
|
60:43 | You're you can do this thing, I'm real subject to use extreme interpreters |
|
|
60:50 | def. You have probably not see here, or you could see you |
|
|
60:55 | heightened by the court here. If don't see anything here, you can |
|
|
60:58 | on this three dogs button here on feel you can select on system interpreter |
|
|
61:03 | it will automatically select the python evolved the stars if you don't see it |
|
|
61:08 | by default. If you miss any this case before, you can definitely |
|
|
61:12 | here and go toe the place where basically installed. You're fighting. So |
|
|
61:17 | started here. So if I select thing, you did not really come |
|
|
61:19 | and fighting that they exist selected. take a look. Okay. Can |
|
|
61:23 | be automatically change to this? This my interpreter now, and then I |
|
|
61:31 | create. So these steps are describing period. Also, if you don't |
|
|
61:36 | you, you can click there. this is where your left that You |
|
|
61:45 | see your family structure for your project here. Once this Hello. |
|
|
61:52 | Selected in photo file. Selecting you will ask you, like what kind |
|
|
61:57 | file you need to select. Fight five on. Then we made |
|
|
62:02 | for example. Follow that five And there then this is created. |
|
|
62:14 | there any question like that? Anyone ? Is there any difficulty to |
|
|
62:17 | What lately are you trying to Whatever were credited. So, |
|
|
62:24 | if you go toe view, there , uh, trying to see, |
|
|
62:33 | , e I can see their Yeah. Now I'm just saying, |
|
|
62:40 | , if you go to view, a presentation mode view. Ah. |
|
|
62:54 | . I don't know why it's must heading for me, actually. Um |
|
|
63:00 | can You can get into presentation mode your python window would be more. |
|
|
63:07 | so both Yeah, in view. the second header is appearances. And |
|
|
63:16 | that, you'll have Oh, presentation more than everything will get |
|
|
63:31 | So we can't really read. you're right. That little program. |
|
|
63:36 | this is very simple program I'm going write. Okay. Basically what? |
|
|
63:54 | trying to show them the interview. why I'm not Okay. Sorry. |
|
|
63:59 | whatever. Yeah, So I don't how to get good from this, |
|
|
64:03 | ? Yeah, that's true. You see the interest. You can only |
|
|
64:07 | the program whichever way you're comfortable. do I exit from this singer? |
|
|
64:29 | , okay. So from here way to pick the run on this around |
|
|
64:36 | here in the green arrow click here likes toe celebration for the person. |
|
|
64:46 | then it wouldn't be a hello world as an artist. If I go |
|
|
64:50 | here, I don't need toe run click run again. I can click |
|
|
64:55 | here So you think hello or So let's create another program. |
|
|
65:03 | And we can particularly work with Mhm. If you go toe. |
|
|
65:13 | that board you can see, like have the assignment files here, a |
|
|
65:17 | 95 If you click here, it'll exit folder like this one. If |
|
|
65:26 | double click here, it will And you see a list of files |
|
|
65:32 | we need for that. But you still in the deep, uh, |
|
|
65:36 | folder. So what way need to is that we have to be |
|
|
65:41 | click and then experience? Yeah, fine. So while you're starting, |
|
|
65:47 | for one of the questions with a of files for you, toe, |
|
|
65:53 | , it's the third question in the . So did you site expected them |
|
|
66:06 | ? So now my files are located this place. If I click on |
|
|
66:11 | one of the files that doctor should , I said like a constitution. |
|
|
66:15 | if I click the property, I see the file's location move. |
|
|
66:24 | just in the general itself. You hear something? Uh, |
|
|
66:33 | yeah. You don't hear the location . So, you know, my |
|
|
66:38 | , uh, one way off handling prices that I copied them to my |
|
|
66:44 | folder. Like, if I goto , uh, this was my basically |
|
|
67:02 | my by jumps or sports were But my downward file is here, |
|
|
67:08 | I can accept them directly from Or I can pop it in that |
|
|
67:11 | show them the board. So, , actually, Roger, can you |
|
|
67:20 | ? Is it easy for you to the size of your phone's just on |
|
|
67:27 | screen, like just screen. If either that or for you either were |
|
|
67:35 | for your whole computer. Yeah. , it might have. He's big |
|
|
68:00 | . That's slightly better. Yes. , so I'm going to use the |
|
|
68:07 | . There's ah, from when this line out, we're going to read |
|
|
68:10 | of the fights have downloaded. for example, uh, that Find |
|
|
68:18 | TV doctor dark TFC. I'm going open this five. Yeah, First |
|
|
68:25 | like we have to create a five and list typing the name. I'm |
|
|
68:38 | this taken personally. Okay, So I want toe for he shows me |
|
|
69:09 | the file not found error. So I'm tryingto such for this file in |
|
|
69:15 | source for their here here. But no violent TV that advocates the |
|
|
69:22 | But as I have already shown you the location off my file is the |
|
|
69:27 | G downloads. If I add this my source book here, right, |
|
|
69:39 | works. You don't show any Let me try to clean whatever the |
|
|
69:44 | line off the families. Okay, is the first line off my |
|
|
69:54 | The few million adult faces. We go to the file, open the |
|
|
70:00 | and see this is my first But is it the area? So |
|
|
70:13 | you cannot find your file from the or something, you feel anything matter |
|
|
70:19 | your country what you can do evil like a copy of all of whiles |
|
|
70:25 | your source folder where your source like hell of fire or homework that fire |
|
|
70:31 | fight fight. Um, source file located. So if I do these |
|
|
70:34 | so I don't need to add this here, I can just write TV |
|
|
70:38 | a dot PHP and I can run sound off folder where my suicide in |
|
|
70:45 | . But I don't need to get full facts if the source and the |
|
|
70:49 | bytes are in the same for So it's also thinking maybe one more |
|
|
71:00 | . Movinto, You're just regular dust and then see what file it is |
|
|
71:06 | try that way. Okay, so now I'm going to believe this thing |
|
|
71:12 | to be clear so that we're not from, like when I'm in the |
|
|
71:17 | on then, uh, be a here, like beautiful files. |
|
|
71:24 | Mm hmm. So let's let's see path off one of these. Just |
|
|
71:32 | like the properties. So you just slow down because it's not so easy |
|
|
71:36 | read. So, user, my name that selfies. Okay, so |
|
|
71:42 | you can just eso just just to sure you're right, Click and |
|
|
71:47 | uh, you get that. just cut that. Copy that and |
|
|
71:52 | put it in your python. So it as this. So this could |
|
|
72:07 | and probably Yeah, trying. Yeah. So what's the reason? |
|
|
72:20 | slash happy the special character, So, yes. So the slash |
|
|
72:26 | to make everybody's life just to make more confusing for you, The slash |
|
|
72:32 | you get when you look for the is the opposite of the flash. |
|
|
72:37 | see this back slash in the but you put the fun slash in |
|
|
72:40 | path so just change those You? . Now for a flash. |
|
|
72:49 | So you just change. The backslash the front slashes, and hopefully it |
|
|
72:53 | work. Yes, it looks Yeah, because the backslash is using |
|
|
73:10 | for many of the special characters. New Line. So back this after |
|
|
73:14 | special character, Yes. You have area? Yeah. So if if |
|
|
73:20 | doesn't have backslash and are therefore, a special character than it was for |
|
|
73:25 | other taken around there, that's Um, so yeah, OK. |
|
|
73:44 | questions? Anybody on Anything we've done far? If you had a chance |
|
|
73:53 | look at the homework, if there's you don't understand, you can bring |
|
|
73:58 | up now. Otherwise, we will ah follow session about the homework on |
|
|
74:05 | . Hopefully, you're all done by . It's not a hard homework. |
|
|
74:11 | , but we will. We will a session anywhere for anybody interested? |
|
|
74:19 | I have something bad. Okay, if you were trying to solve, |
|
|
74:25 | , there's a mention person number one from the book itself. You don't |
|
|
74:29 | this part thing because from book, it is used that that you have |
|
|
74:34 | to keep the debt about taste in same folder? Yeah. Yeah. |
|
|
74:41 | when you access the file them in book, think off it that you |
|
|
74:45 | running from the same folder as the . So you don't have. Of |
|
|
74:50 | , you don't have the back name the book. But that should |
|
|
74:55 | And really, if you have even little bit of time, I would |
|
|
75:00 | what you're there. Download, by charm and do it will be |
|
|
75:05 | more pleasant to do those and bites . But in the end, you |
|
|
75:10 | submit in the book, which you cut, Invest of working program, |
|
|
75:17 | , so on. And it really , even if you're it's not that |
|
|
75:23 | . So download and install pipes on and get it running. Many of |
|
|
75:27 | have already done it. Um, it's it's a good skill to have |
|
|
75:33 | . So two important things that you to remember one is like where you |
|
|
75:38 | in this entire process, where your start the system is supposed to pick |
|
|
75:43 | up. If you have click the box at Bath toe. The administration |
|
|
75:48 | the next important thing is here. like the your project location where yourself |
|
|
75:55 | so many of the students who had using, uh, they're like finding |
|
|
76:01 | source file on a Mac book. a common mistake. Many off the |
|
|
76:07 | programmers do it like the copy. have their file on the desktop. |
|
|
76:10 | have their source filing somewhere in the . And then then try toe. |
|
|
76:15 | don't find the source file or the files. So easy way to find |
|
|
76:21 | source file is looking to this You can use your file explorer if |
|
|
76:25 | using other than Windows, you can your file ex wherever you can look |
|
|
76:29 | your fight. That that part and will find the society. Wow. |
|
|
76:45 | , you're done. Picture? Okay. All right. So will |
|
|
76:52 | here for the next several minutes. anybody is anybody has questions. |
|
|
76:58 | then we have the first recession. then there's lots of office hours on |
|
|
77:04 | . Try to get this done We're going to release the next assignment |
|
|
77:09 | . Also, the only the final assignment is already out. Eso that |
|
|
77:17 | week you can focus more on preparing your your final and be done with |
|
|
77:26 | ? Um, yeah. Okay. , if there's any questions off any |
|
|
77:36 | , bring them up now. Otherwise going. Thio officially closed the |
|
|
77:44 | Thanks for sticking around. And if often office hours type questions, just |
|
|
77:52 | around and we can talk to you |
|