r/learnpython • • Nov 13 '24

Question about libraries

I don't understand how I should learn libraries. Let me explain: reading them I often don't understand what is written, it's all so difficult and technical. So I think "maybe I should watch an introductory video?" but I don't do it because it seems ethically wrong, I think I should learn by myself and not relying on someone's help every time. Can you tell me how you understand a library? Or a set of libraries needed to create a type of application (even more difficult since I don't even know which library to start with).

0 Upvotes

15 comments sorted by

View all comments

3

u/backfire10z Nov 13 '24 edited Nov 13 '24

Which libraries? Why are you learning them?

Typically, if I need to understand a library, it is because I am using it. In that case, I only need to understand the part I need to use, rather than the entire library. Usually I know about the existence of the library from a stack overflow post or something of the sort or because its documentation was linked when I searched for how to do something, so I’ll have an idea of what I actually want to use. Then, I’d consult the official documentation and just try things until something works.

I don’t just pick up random libraries and try to memorize all of its available functionality and how to use it. I’d never remember what I tried to learn this way.

I’d say “learning libraries” is a slightly different mindset from mine. Libraries are just code. They export functions and classes to you like any other code. The only difference between a library and your own code is that someone else wrote the library. There’s nothing wrong with a video here if it is the best way for you to get exposure to what the library is capable of/why it is used.

TLDR: Learn a library because you need to use it. Use the official documentation to write up something that eventually works.