The video owner has disabled playback on external websites.

This video is no longer available on YouTube.

This video cannot be played right now.

Watch on YouTube

AI 학습 도구 잠금 해제

가입하여 모든 동영상에서 더 빠르게 학습할 수 있는 강력한 도구를 이용하세요.

장면 설명 표현 찾기 플래시카드 복습 섀도잉 연습 되말하기
무료 회원가입
B1 중급 영어 15:39 2,570 단어 Science & Tech

Python Has the Best Standard Library Ever: 10 Modules You Need to Know

Late Night with Seth Meyers · 101,985 조회수 · 추가됨 1개월 전

AI 요약

This video explores Python's powerful built-in standard library, highlighting modules that streamline development and reduce the need for external dependencies. Learners will discover how to simplify data structures using **dataclasses** and manage file systems more intuitively with the object-oriented **pathlib**. The tutorial also covers **functools** for performance optimization through caching, **tomllib** for native configuration parsing, and **graphlib** for managing complex task dependencies. Finally, it introduces **heapq** for efficient priority queue management. By mastering these underutilized tools, viewers will gain the skills to write cleaner, more "Pythonic" code and improve their software design efficiency.

학습 통계

B1

CEFR 레벨

2,570

총 단어 수

609

고유 단어

4/10

난이도

어휘 다양성 24%

자막 (381 세그먼트)

00:00

Python's standard library is crazy

00:02

powerful. Most people know about JSON or

00:05

OS, but there are modules that can save

00:08

you hours of work and you're probably

00:10

not using them. Today, I'll show you 10

00:13

powerful standard modules you should

00:16

absolutely know about. Before I start,

00:18

if you want to learn more about how to

00:20

design a piece of software from scratch,

00:22

I have a free guide for you. You can get

00:24

it at iron.code/design

00:26

guide. This contains the seven steps I

00:29

take when I design new software and

00:31

hopefully it helps you avoid some of the

00:32

mistakes I made in the past. The link is

00:35

also in the video description. First

00:37

module I want to talk about is data

00:39

classes. Now you are probably already

00:41

using data classes, but I still think it

00:44

deserves a mention on this list. You

00:47

might also say, "Hey, didn't you do a

00:49

video a couple of weeks ago where you

00:50

said you were no longer using data

00:52

class? So what is this all about?" Well,

00:54

it's not that I'm no longer using data

00:56

classes. I actually still use them, but

00:59

I don't use them in production systems

01:02

as much because then I notice that I

01:04

often end up using things like Pantic or

01:06

whatever ships with the specific

01:09

framework or library I'm working with.

01:11

Now, data class themselves are still

01:14

quite helpful to me. I really use them

01:16

quite often for quickly coming up with

01:18

some ideas in my Python scripts,

01:20

creating a few classes that store a bit

01:22

of data, making some relationships, and

01:24

seeing how everything fits together. And

01:27

for me, data class work really well for

01:28

that because they're just so easy to

01:30

use. Here you see an example of how they

01:32

work. So you simply import the data

01:34

class decorator from data classes. You

01:37

put that on top of your class and then

01:38

you specify the attributes of the class

01:41

by using type annotations. You can do

01:44

default values like this which is really

01:46

helpful. And there's a ton of other

01:48

things as well. For example, you can

01:49

also make a data class frozen. And that

01:53

way if you do that and actually type

01:56

booleans correctly, then you can also

01:58

make read only data class, read only

02:01

objects, which is quite nice as well.

02:04

Also, data classes add a bunch of

02:06

default behavior. For example, in this

02:08

case, as you can see, there's no need

02:09

for initializer, but we still have one

02:11

where we can pass the arguments uh as we

02:14

want. Uh there is a wrapper. So, if you

02:17

print a in this case an instance of that

02:20

data class, it's going to give us

02:22

something useful instead of just the

02:23

memory address. So, overall data classes

02:26

are really helpful for that. Here you

02:28

see what we get as a result when I run

02:30

this little piece of code. The second

02:32

library that I think more people should

02:34

use is path lip which basically supplies

02:37

a modern way of dealing with file path.

02:40

It replaces os.path with an

02:42

object-oriented approach to file path.

02:44

And the nice thing about path lil is

02:47

that you can use the slash operator to

02:49

construct more complex paths. So in this

02:52

case I have my base which is the my

02:54

project folder. That's a path object.

전체 자막은 비디오 플레이어에서 이용 가능

핵심 어휘 (50)

you A1 pronoun

당신은 누구십니까? (Who are you?)

run A1 verb

달리다: 그는 매일 아침 공원에서 달립니다. 운영하다: 그녀는 서울에서 작은 디자인 회사를 운영합니다.

create A1 verb

창조하다 또는 만들다라는 뜻으로, 이전에 없던 새로운 것을 만드는 것을 의미합니다. 작가는 새로운 이야기를 창조합니다.

연습 문제로 학습하기

이 동영상에서 어휘, 문법, 이해력 연습 문제를 만드세요

어휘 및 문법 이해력 퀴즈 IELTS 시험 쓰기 연습
회원가입해서 연습하기
아직 댓글이 없습니다. 첫 번째로 생각을 공유하세요!

가입하고 모든 기능 잠금 해제

진행 상황 추적, 단어 저장, 연습 문제 풀기

무료로 언어 학습