1. Query module: According to the directory to find the module to be imported, module directory generally in:/usr/lib64/python2.7In [2]: sys.pathout[2]:[', '/usr/bin ', '/usr/lib64/python2.7/site-packages/mysql_python-1.2.5-py2.7-linux-x86_64. Egg ',
Starting today, I'm going to keep writing a blog every week, a review of my week's learning summary and knowledge. This can deepen the understanding of learning and understanding, small language or something is not good, but I do not write novels
Title: Python achieves three landingsDo not rush to write three times immediately, it is necessary to simplify the complex procedures, you must step-by-step to expand, so as to ensure that there will be no error.Step one: Achieve a simple one-time
The following main points are from: http://wiki.jikexueyuan.com/project/explore-python/Standard-Modules/argparse.htmlArgparse using a simple exampleLet's look at a simple example first. There are three main steps:
Create a Argumentparser ()
Threads and processes, whether using methods or concepts, are almost the same, with the main distinction being that the conceptual aspects of different threads can be thought of as part of a process, which is divided into the primary and child
Tag:details copy logic judgment ant ping print sel net usage Python if not determines whether the case is none if the Xif x is Noneif isn't x is none if the X is not none "is the best way to do it, clear, without errors, and
The generator is also an iterator that computes the next data on demand with the next () functionList Builder, which makes the code more concise, only records the current location, only __next__ (),(I*2 for I in range (10))Generator (Generator)1
Identifiers in Python can contain numbers, letters, and _, but must begin with a letter or _, where a name beginning with _ generally has a special meaning.Both front and back are named with double underline __Typically used for naming special
Lebyan: Make your code more concise>>> [i*2 for I in range (10)][0, 2, 4, 6, 8, 10, 12, 14, 16, 18]Generator is to save memory space, the generator will be called when the corresponding data generated, not called when only allocating memory;There is
Weekend, but I'm not fit to have a weekend ah, 7.9 awake, continue to look at Python, yesterday downloaded a tool pycharm, this tool and idea is a family. Use almost, today continue to look at the foundation.Write format: Python is particularly
Two. Install PIP for python3.xIn fact, this is not difficult. Download a package and execute two commands.1. First install the SetuptoolsSmall partners can be downloaded via the Official module library: Https://pypi.python.org/pypiHere I will
---restore content starts---Array listAdd the. Append (i, ' xxx ') methodDelete with the. Pop (i) method, where I is the index positionArray can be inserted directly as an elementTuple tuples (cannot be changed after initialization, so-called
Introduction to int internal functionsYou can view all the functions inside an int by using the Dir (value of type int) or by CTRL + click Int. Internal functions are many, but many of the internal functions are not commonly used, the following are
Python uses regular expressions to replace successfully matched groups and outputs the number of replications. python Regular Expressions
A regular expression is a special character sequence that helps you easily check whether a string matches a
Python virtualenv simple usage (required), pythonvirtualenv
What is virtualenv?
Virtualenv can create an independent Python development environment. For example, the current global development environment is python3.6. Now we need to use django1.3
Python auto crop image code sharing, python image Cropping
This code can help you automatically cut out the blank area on the edge of the image. If your image has a large blank area (as long as it is the same color to form a certain area, it is
Describes how to use Python to compile the vim plug-in and the pythonvim plug-in.
Preface
Vim is a great editor, not only in her maverick editing method, but also in her powerful scalability. However, vim's language vimL function for writing
Example of the bucket sorting algorithm implemented by Python and the python Sorting Algorithm
This example describes the bucket sorting algorithm implemented by Python. We will share this with you for your reference. The details are as
Exploration of python decorators and collection of parameters, and decoration of python
First, go to the original article,
Now, let's assume that we want to enhance the functions of the now () function, for example, to automatically print logs
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service