#🔒 how to learn a library
99 messages · Page 1 of 1 (latest)
@strange sinew
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
What library/module do you want to learn
Whenever I try learning a library, I open the doc and start my editor. Then whatever I'm reading, I try to apply it immediately and see if it makes sense.
yeah but idk what any of it does
Likewise when I get stuck, I ask a specific question about it.
You can also use help() in your code to print out what a function does like this:
import x
help(x.something)
yeah but that just reads what the documentation says doesn't it
the documentation is hard to understand for me
i might be low iq
this stuff is so hard
Why don't you try asking specifically what is confusing you about it?
bc everything confuses me
i went on the sockets documentation
read like 5 functions
and didnt understand anything
The documentation is technical, you'll get used to it over time.
Have a look at some videos explaining how to use it maybe but make sure you are trying to use parts of it that you have learned
I guess thats a problem. You are tackling everything. Tackle one at a time. Ask one at a time. Don't get overwhelmed
yeah but like where do i start
then
First thing comes to mind
i hope so bro this stuff actually has me contemplating quiting
if you really don't understand it, you might not have as solid a foundation as you initially thought
can you point to a specific thing you don't understand?
wdym like
show us a function you read and don't understand
specific function or?
AF_PACKET is a low-level interface directly to network devices. The addresses are represented by the tuple (ifname, proto[, pkttype[, hatype[, addr]]]) where:
ifname - String specifying the device name.
proto - The Ethernet protocol number. May be ETH_P_ALL to capture all protocols, one of the ETHERTYPE_* constants or any other Ethernet protocol number.
pkttype - Optional integer specifying the packet type:
PACKET_HOST (the default) - Packet addressed to the local host.
PACKET_BROADCAST - Physical-layer broadcast packet.
PACKET_MULTICAST - Packet sent to a physical-layer multicast address.
PACKET_OTHERHOST - Packet to some other host that has been caught by a device driver in promiscuous mode.
PACKET_OUTGOING - Packet originating from the local host that is looped back to a packet socket.
hatype - Optional integer specifying the ARP hardware address type.
addr - Optional bytes-like object specifying the hardware physical address, whose interpretation depends on the device.
like what does this even mean
AFPacket
I personally don't know anything about sockets so can't really answer you there 😦
do you know anything about requests
bc that is also so hard for me to understand
maybe this just aint for me idk i might quit
very little
what are your goals with python?
you don't need to know every single library
I've been using python 6+ years and don't know requests or sockets
i want to do reverse engineering eventually but i was just learning python bc someone recommended me to start with that, but I was going to try to learn networking and some web scraping with it aswell
ik reverse engineering is like C++/C and assembly
If you have just started, make sure you know the basics before jumping into the more advanced stuff. Also train your logic by building small projects or doimg challenges, otherwise you'll get overwhelmed and then get stuck.
no like i have projects in mind and ik the basics but it's using libraries and stuff that confuses me bc with the basics i just watched youtube vids to understand everything and with libraries, there arent really youtube videos explaining every single function
2 months is not a lot of time to have spent learning python
thats when i understood all the basics, i've been learning python for 4 months
but still not too long
have you learned OOP?
I'd recommend that first then
object oriented programming?
yes
like bro the os module was so easy then i started working with
sockets
and idk what anything means
how is it so hard
I don't think any of us goes to read the actual docs, as in, the whole document of all functions etc etc. More finding out how to do certain things. See if there are any examples in the docs is usually your first bet. The "Getting Started" section if they have one. After that, you can look for specific function names, they should be named appropriately. (example for pandas: read_csv() will, read a csv.. etc)
because connecting unrelated software isn't necessarily an easy task
sockets are pretty complicated, but overall when using a library for something, you must understand how that "something" works before you try to touch the library at all
For example, if you didn't know how multiplication works, you would not be able to create nor even use a calculator - it's the same for more complicated computer things, you must learn it conceptually first before using tools built around those concepts
After you get some basic knowledge and a sample setup, which does not entirely do what you want but at least something is working. You start to find out how you can tweak it for what you really need.
so with this in mind should i try to learn html and css before doing the requests library
a little but not really, requests requires for you to understand how HTTP and HTTPS works, not necessarily html/css
so you learn http and https before you learn requests and not as you learn requests?
Yes.
You'll likely want to test what you have learned in requests as soon as you learn it, but strictly speaking, you'll have to learn it before you actually use it
most knowledge doesn't have a definitive start and end, so you just need to know enough to get started
so what should i do to learn that just watch youtube videos on how http works?
look up something like Introduction to REST APIs
whats an api
yep, that's precisely why you are having a hard time with requests
like stuff like that just makes me feel so stupid
an api is a way to use code to interface with other code
did you even try looking up a tutorial for requests on google/youtube?
and it did not mention apis?
no
they were just doing explaining diff types of requests like get requests, post, etc
and status code
all that
If you want to work with sockets you should read a general introduction to network programming. The sockets module docs aren't enough, they assume you're already familiar with the idea of sockets.
The best guide on this I know is https://beej.us/guide/bgnet/html/split-wide/, although it's in C the sockets interface is similar in Python so it should still be useful.
Alternatively, read https://docs.python.org/3/howto/sockets.html and https://realpython.com/python-sockets/
Author, Gordon McMillan,. Abstract: Sockets are used nearly everywhere, but are one of the most severely misunderstood technologies around. This is a 10,000 foot overview of sockets. It’s not reall...
but yeah, this is what a API is
a REST API is specifically a type of API built around network requests, with some common rules you do not have to worry about for now
That's why, you aren't stupid you just haven't heard of apis. Look into them first
I'd recommend looking into requests before sockets, but +1 for realpython - it also has a tutorial for requests, https://realpython.com/python-requests/
Networking and sockets are large subjects. Literal volumes have been written about them. If you’re new to sockets or networking, it’s completely normal if you feel overwhelmed with all of the terms and pieces.
from that article
bro you're really helpful, is this the first thing I should look at when learning requests
yeah probably
For the best experience working through this tutorial, you should have basic general knowledge of HTTP. That said, you still may be able to follow along fine without it.
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.