Python libraries and packages » |
My Coding >
Programming language >
Python >
Python libraries and packages
Python libraries and packagesPython offer a lot of different libraries and packages for working with different data and tasks. It is a high chance that almost all basic task you need to solve, already solved in one of the libraries, so it is better to check them first. How to use Python librariesHow to install Python libraryMany basic libraries are installed together with Python core package, but some of them need to be installed additionally To install library with pip use:
To install library with conda, use:
Check installed libraries with pipIt is very easy to check, what libraries of packages you already have
To output installed packages in requirements format, use parameter freeze for pip
The detailed information about installed package it is possible to fetch with pip command with option ‘show’
Check installed libraries with condaRun conda with parameter list to receive full list of installed packages for Python
How to use Python librariesThere are three main ways of importing Python libraries into your script. You can import library as it is and use later full name ogf this library
It is possible to shorten name of the library for more simple coding
Also, it is possible to import only one or few functions from library and use they names
If you’ve import library, you can have a list of all functions, variables and methods defined in this library
|
Last 10 artitles
9 popular artitles
|
||||||||
© 2020 MyCoding.uk -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit. |