Python in Education



Download 3,73 Mb.
Pdf ko'rish
bet27/37
Sana01.01.2022
Hajmi3,73 Mb.
#303345
1   ...   23   24   25   26   27   28   29   30   ...   37
Bog'liq
Python in Education (en)

Open Extensibility

Despite the powerful simplicity of the core language, programmers

often need to reuse existing library modules of code to achieve a

common task. A library module is like a recipe book of instructions

for carrying out certain related tasks. It means programmers don’t

have to start from scratch or reinvent the wheel every time they

encounter a common problem.

While most programming languages have mechanisms to write and

reuse libraries of code, Python is especially blessed in having a large

and extensive standard library (built into the core language), as well

as a thriving ecosystem of third-party modules.

For example, a common task is to retrieve data from a website. We

can use the 

requests


 third-party module to download web pages

using Python:

>>> import requests

>>> response = requests.get('http://python.org/')

>>> response.ok

True


>>> response.text[:42]

'\n  

(This code tells Python that we want to use the requests library, gets

the HTML for 

Python’s home page

, checks that the response was a

success [it was] and displays the first 42 characters of the resulting

HTML document.)

Some modules, such as 

requests


, do one thing and do it exception‐

ally well. Other modules are organized into large libraries to create

application frameworks that solve many of the repetitive tasks

needed when writing common types of application.




Download 3,73 Mb.

Do'stlaringiz bilan baham:
1   ...   23   24   25   26   27   28   29   30   ...   37




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish