A
A
ARTESS7772018-08-16 23:36:11
Python
ARTESS777, 2018-08-16 23:36:11

Explain to a newbie about modules and libraries?

Hello. I am a beginner programmer, 14 years old (self-development, in the future I will become a programmer). Here I studied C ++, there you can connect libraries. Now I'm studying python and in the video lesson it says that you can connect modules. I started googling, and found out that there are still packages, all sorts of systems. What it is? can you please explain. What is different from what and how it is used. Thank you for your time
(PS Sorry for the stupid question)  

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alex F, 2018-08-17
@ARTESS777

Denis Melnikov , before writing about import, it would be nice to say that python comes with a minimum number of libraries. Then talk about import and finish installing the missing libs via pip/easy_install.
Living example: A person wanted to realize, say, the phases of the moon. He took out a reference book on astronomy, leafed through and became scared. Then I googled and found:

import ephem
obs = ephem.Observer()
sun = ephem.Sun()
obs.lat = lat
obs.long = lng
obs.date = datetime.datetime.today()
rise_time = obs.next_rising(sun)
...............и так далее

Wrote / copied and pasted and received: And again Google ... So shta igorzakhar said a little more correctly. But it should have been added, when pointing out Lutz, that there is a separate chapter on installing modules . In general, TS, read BOTH books by M. Lutz first.

D
Denis Melnikov, 2018-08-17
@Mi11er

One bullshit.
import package\libs
Type
import os
from os import *
import request as req
You can also write your own libs and import them.

I
igorzakhar, 2018-08-17
@igorzakhar

I liked the way it was presented here:
Python: Imports and Modules - Part 1.
Python: Imports and Modules - Part 2.
+ No one canceled the classic "Learning Python" by Mark Lutz.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question