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

ابزارهای یادگیری هوش مصنوعی را باز کنید

ثبت‌نام کنید تا به ابزارهای قدرتمندی دسترسی پیدا کنید که به شما کمک می‌کنند سریع‌تر از هر ویدیو یاد بگیرید.

توضیح صحنه شکارچی عبارات مرور فلش‌کارت تمرین تکرار مکالمه تعاملی
ثبت‌نام رایگان
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,982 بازدید · اضافه شده 1 ماه پیش

خلاصه هوش مصنوعی

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

تو دوست منی. (You are my friend.)

run A1 verb

دویدن: او هر صبح در پارک می‌دود. اداره کردن: او یک شرکت بزرگ را اداره می‌کند.

create A1 verb

خلق کردن یا ایجاد کردن به معنای به وجود آوردن چیزی جدید است. یک هنرمند یک اثر هنری زیبا خلق می‌کند.

با تمرین‌ها یاد بگیرید

تمرین‌های واژگان، گرامر و درک مطلب از این ویدیو بسازید

واژگان و گرامر آزمون درک مطلب آزمون IELTS تمرین نوشتاری
ثبت‌نام برای تمرین
هنوز نظری وجود ندارد. اولین نفری باشید که افکار خود را به اشتراک می‌گذارد!

ثبت‌نام کن و همه امکانات رو باز کن

پیشرفتت رو دنبال کن، واژگان رو ذخیره کن و تمرین کن

شروع رایگان یادگیری زبان