Copyright, without permission, is prohibited reprint
chapter
- Python Introduction
- Python development environment to build
- Python syntax
- Python variables
- Python Value Type
- Python type conversion
- Python String (String)
- Operators Python
- Python list (list)
- Python tuples (Tuple)
- Python collection (Set)
- Python dictionary (Dictionary)
- Python If … Else
- Python While loop
- Python For loop
- Python functions
- Python Lambda
- Python Classes and Objects
- Python inheritance
- Python iterator (Iterator)
- Python module
- Python date (Datetime)
- Python JSON
- Python regular expression (RegEx)
- Python PIP package manager
- Python exception handling (Try ... Except)
- Python Open File (File Open)
- Python read file
- Python write file
- Python delete files and folders
What PIP that?
PIP is a Python package manager, like in Java Maven .
Note : If the Python version 3.4 or later, included by default PIP.
What is the package?
A package that contains all the files of a module.
Module is a library of Python code can be imported in the project, used.
Check whether the installation PIP
Command line, execute the following command:
Kevin@KEVIN-PC C:\Users\Kevin
> pip --version
pip 19.0.3 from d:\program files\python\lib\site-packages\pip (python 3.7)
Download a package
Download package is very simple.
Open a command-line tool, execute pip install 包名
the command:
Examples
Download a Python package called "camelcase" of:
Kevin@KEVIN-PC C:\Users\Kevin
> pip install camelcase
Use a bag
Once the package is installed, it can be used.
The "camelcase" package into the project.
Examples
Import and use "camelcase":
import camelcase
c = camelcase.CamelCase()
txt = "long time no see"
print(c.hump(txt))
Find package
For more packages visit https://pypi.org/ .
Delete Package
You can use the uninstall
command to delete a package:
Examples
Uninstall package called "camelcase" of:
Kevin@KEVIN-PC C:\Users\Kevin
> pip uninstall camelcase
Delete package procedure, will confirm whether you really want to delete:
Uninstalling camelcase-0.2:
Would remove:
d:\program files\python\lib\site-packages\camelcase-0.2-py3.7.egg-info
d:\program files\python\lib\site-packages\camelcase\*
Proceed (y/n)? y
Successfully uninstalled camelcase-0.2
Press the y
button to confirm the deletion.
Package list
Use list
command to list packages installed on the system:
Examples
Package installed on the system are listed:
Kevin@KEVIN-PC C:\Users\Kevin
> pip list
Output:
> pip list
Package Version
---------- -------
pip 19.0.3
setuptools 40.8.0