Jump to content

Libraries in Python

Experience and Intro

Hey guys, so I'm reading a book, "Learning Python (5th Edition)", about the Python Programming Language that should greatly help teach me how to program in Python. I don't know any programming languages, but my experience is this:

  • I've coded like three very very simple games in C#, two that were just guessing games of the binary search algorithm, and I coded the games just by learning side by side from a video course.
  • This school year (2017-2018 as a Sophomore in High School) I took an AP Computer Science Principles class where learned a lot about the major building blocks of programming and computer science like bits, binary, variables, very basic idea of functions, parity bits, logic statements like if then else else if, logic gates like NAND XOR etc., search and sort algorithms, other number forms (hexa decimal, decimal, ASCII), and we made some apps in MIT App Inventor. There might be a few more things but I forgot.
  • I have a big passion for programming and love everything about it.
  • My career plan is
    • From now until I get into my dream job I want to have learned at least Python, Java, and C++. Obviously I will probably learn many little languages here and there
    • Go to Georgia Tech
    • Get a Masters Degree in AI
    • From High School until my final job, I want to get internships and temporary jobs in as many tech companies as I can
    • I want to have moved to Cali near, if not, in Silicon Valley at some point
    • After years and years of hard work I want to end up at Google Mountain View California

I hope to gain as much help as I can from everyone here and hope to create amazing things.

 

What I need help with

So in the beginning of the book, the Author is talking about the Python programming language and everything about it and as he is talking about support libraries (can someone define that) I think about all the times I've heard people take about libraries. I've always assumed that libraries in programming are the many functions built into the programming language that you can use, for example. If I am programming a certain PC application that requires searching through a bunch of stuff and in the beginning of my code I include (making up names) library.SearchAlgrth, then if I wanted to use a prerecorded search algorithm then I would just use it from the library.

 

Basically, what I need answered:

  • What does the author mean when the title of a pargraph talking about libraries was called Support Libraries
  • What is a library in programming, what is it used for, and just whatever I need to know about it
  • Anything else basic that would be heplful

Anything is appreciated :)

Retrowave

Air cooled version of my first PC.

 

CPU: Intel Core i7-8700K

Cooler: Corsair H150i PRO

Thermal Compound: Thermal Grizzly Kryonaut Thermal Paste

Motherboard: Asus ROG MAXIMUS X HERO (WI-FI AC)

RAM: G.Skill Trident Z RGB 32GB (4 x 8GB) DDR4-3600 Memory

SSD: Samsung 960 Pro 512Gb M.2-2280 Solid State Drive

SSD 2: Samsung 970 EVO Plus 1TB M.2-2280 Solid State Drive

HDD: WD Black 6TB 3.5" 7200RPM Internal Hard Drive

HDD 2: Seagate Barracuda PRO 4TB 3.5" 7200RPM Internal Hard Drive

GPU: EVGA GeForce GTX 1080 Ti FTW3

Case: LIAN LI O11 Dynamic XL

PSU: EVGA SuperNOVA P2 1000W 80+ Platinum Fully-Modular ATX Power Supply

Case Fans: Corsair LL120

Fan Controller: Corsair Commander Pro

 

Set Up

  • Mouse: Razer Deathadder Elite
  • Keyboard: Razer Blackwidow X Chroma
  • Mousepad: Steelseries QcK Gaming Mousepad
  • Monitor: Asus ROG Swift PG278QR
  • Audio
    • AMP: Sennheiser GSX1000
    • Headphones: Sennheiser 58X
    • Speakers: Bose Companion 2 Series III
  • Oculus Rift + Touch 3 Sensor Roomscale Setup
Link to comment
Share on other sites

Link to post
Share on other sites

15 minutes ago, G3ORG3Douj88 said:

I've always assumed that libraries in programming are the many functions built into the programming language that you can use, for example.

Libraries are basically just a collection of functions you can use, but not necessarily functions built into the programming language. They can range from all sorts of things from making pretty plots to making advanced neural networks for an AI. Libraries are something you use because you need that specific functionality.

For example, Python has the Numpy/Scipy libraries for a significant boost in both speed and ease of use of a lot of mathematical stuff, whereas matplotlib is one of many plotting libraries.

 

The reason it's not  baked into the programming language is that nobody needs everything. If you want to make a pretty plot of your measurements, you have no need for neural networks. The language provides you with the language itself, and some core libraries that you likely do not want to live without. The rest is up to you.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

Wish I had that much enthusiasm about learning programming :P

Quote
  • What does the author mean when the title of a pargraph talking about libraries was called Support Libraries

First, you have the Standard Library - basically all the functions come by default with Python, such as print, if-else, and other built-in functions. A support library (usually from the PyPI, or Python Package Index) is a library that uses the Standard Library to create other functions. For example, Numpy is a pretty popular one for creating and managing huge arrays and matrices, that (usually) Python cannot do on its own. Another one would be an API wrapper to access a website's API.

 

Quote
  • What is a library in programming, what is it used for, and just whatever I need to know about it

A library is a package that provides an array of functions for the user, usually to make things easier. As previously stated, there are some libraries that provide a wrapper to access a website's API. Instead of manually making and processing a request using several functions, you can do it with just one function from another library.

 

Quote
  • Anything else basic that would be heplful

You can download packages/libraries from the PyPI using the pip command in a terminal. On Windows, I believe it comes with a regular Python installation.

For example, if you wanted to install Numpy, you'd type:

pip install numpy

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, tikker said:

Libraries are basically just a collection of functions you can use, but not necessarily functions built into the programming language. They can range from all sorts of things from making pretty plots to making advanced neural networks for an AI. Libraries are something you use because you need that specific functionality.

For example, Python has the Numpy/Scipy libraries for a significant boost in both speed and ease of use of a lot of mathematical stuff, whereas matplotlib is one of many plotting libraries.

 

The reason it's not  baked into the programming language is that nobody needs everything. If you want to make a pretty plot of your measurements, you have no need for neural networks. The language provides you with the language itself, and some core libraries that you likely do not want to live without. The rest is up to you.

When I say built into the programming language I actually meant they were a library of functions that were in the programming software or something that whatever code I write can just use. And although I'm 95% sure this is true, functions are basically like variables that store code but way more complicated and can even take and output values.

And thanks so much for the help!

Retrowave

Air cooled version of my first PC.

 

CPU: Intel Core i7-8700K

Cooler: Corsair H150i PRO

Thermal Compound: Thermal Grizzly Kryonaut Thermal Paste

Motherboard: Asus ROG MAXIMUS X HERO (WI-FI AC)

RAM: G.Skill Trident Z RGB 32GB (4 x 8GB) DDR4-3600 Memory

SSD: Samsung 960 Pro 512Gb M.2-2280 Solid State Drive

SSD 2: Samsung 970 EVO Plus 1TB M.2-2280 Solid State Drive

HDD: WD Black 6TB 3.5" 7200RPM Internal Hard Drive

HDD 2: Seagate Barracuda PRO 4TB 3.5" 7200RPM Internal Hard Drive

GPU: EVGA GeForce GTX 1080 Ti FTW3

Case: LIAN LI O11 Dynamic XL

PSU: EVGA SuperNOVA P2 1000W 80+ Platinum Fully-Modular ATX Power Supply

Case Fans: Corsair LL120

Fan Controller: Corsair Commander Pro

 

Set Up

  • Mouse: Razer Deathadder Elite
  • Keyboard: Razer Blackwidow X Chroma
  • Mousepad: Steelseries QcK Gaming Mousepad
  • Monitor: Asus ROG Swift PG278QR
  • Audio
    • AMP: Sennheiser GSX1000
    • Headphones: Sennheiser 58X
    • Speakers: Bose Companion 2 Series III
  • Oculus Rift + Touch 3 Sensor Roomscale Setup
Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, G3ORG3Douj88 said:

When I say built into the programming language I actually meant they were a library of functions that were in the programming software or something that whatever code I write can just use. And although I'm 95% sure this is true, functions are basically like variables that store code but way more complicated and can even take and output values.

And thanks so much for the help!

That's what I meant as well. To stick with Python, like @t4ils said, there's the standard library that everyone who installs the language has and can use out of the box and there are support libraries, external libraries, whatever you want to call them. This will be true for any language.

 

That's what a function is yes. It can take input, does something and can give output.

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×