Answer the question
In order to leave comments, you need to log in
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
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)
...............и так далее
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 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 questionAsk a Question
731 491 924 answers to any question