Python's package in this area are very complete:
Web crawler: Scrapy (not very clear)
Data mining: NumPy, scipy, Matplotlib, Pandas (first three are industry standard, fourth analog R)
Machine learning: Scikit-learn, LIBSVM (excellent)
Natural
Lambad expression
A lambda expression can create a function that can be called, but it returns a function instead of assigning a function to a variable name, so a lambda function is also called an "anonymous function."
The form of a lambda
Common Standard Library
Standard library DescriptionBuiltins built-in function default loadOS Operating System interfaceSYS Python's own operating environmentCommon Tools for FunctoolsJSON encodes and decodes JSON objectsLogging Logging,
Python uses a backslash (\) to escape characters when special characters need to be used in characters. The following table: original string
Sometimes we don't want the escape character to take effect, we just want to show the original meaning of
PYTHON3.0 does not exist, the old version may have an error:
Class A ():
def __init__ (self):
print (' A ')
class B ():
def __init__ (self):
print (' B ')
class C ():
def __init__ (self):
print (' C ')
class
After Ansible 2.0, there was no run this API, On the internet to find a lot of officials 2.0 of the API, found that the call, the return result is only 0 and 1, can not get the same results as running, after research, finally use the following code
Create a Scrapy item definition extract item write crawl site spider and extract item write item Pipeline to store extracted item (i.e. data)
Scrapy is written by Python. If you have just contacted and wondered about the nature of the language and
This article describes the URL mapping, before we introduce the mapping, we first understand what is the URL? The URL (uniform/universal Resource locator abbreviation, Uniform Resource Locator) is a concise representation of the location and access
Batch modification file name
import os
dir = os.getcwd ()
dir = Os.chdir (R ' C:\Users\Administrator\Desktop\cupdata ')
j = 0 for
file in Os.listdir (dir):
#os. Listdir ('. ') Traverses each file name within the folder and returns a list if
package into zip file
Import ZipFile
f = zipfile. ZipFile (' Archive.zip ', ' W ', ZipFile. zip_deflated)
f.write (' file_to_add.py ')
f.close ()
unpack from zip file
Import os,sys
import zipfile
import re
os.chdir
>>> help (ones)
the function ones in module numpy.core.numeric:
ones (Shape, dtype=none, order= ' C ') C2/>return a new array of given shape and type, filled with ones.
Please refer to the "documentation for ' zeros" for further details.
Also
----
Python is a dynamic language, relatively concise. Android does not directly support the development of applications using Python, and requires the use of other middleware or libraries. Pythonforandroid provides support for the Python language on the
Source: http://ctf.idf.cn/index.php?g=game&m=article&a=index&id=45Python bytecodePlease look here: Http://pan.baidu.com/s/1jGpB8DSAfter downloading is a file named Crackme.pyc
Python reverse infrastructure: Using Python to decompile python software:
You need to install the Python web, you need to install the PIP, and the installation method resolves itself.To install the Python Web:
sudo pip install web.py
The problem with the NO socket could be created was encountered while learning the
Nothing's going to happen today. The Python compiler for the beginner tutorial found it interesting to figure out what it was, so I entered the following code:
Import Sys,os
print (sys.version_info) print (sys.executable) print (sys.path[0)
GitHub user Followers analysis
How to analyze a github user's followers.
Weekend preface, with Python analysis of their own GitHub followers users, the statistical results of the following problems analysis
On the GitHub, a user's home page is
Transferred from: https://www.cnblogs.com/chamie/p/4917820.html Random ()Random () Method: Returns a randomly generated real number that is within the range of [0,1]Syntax for using the random () method:The import random #random () method is not
1.1.Event-Driven Event-driven is a programming paradigm, a programming style that specializes in dealing with unknown events by binding an event, activating the thing after an external trigger, and achieving the purpose of performing certain
# by Luffycity.com# dead Loop# count = 1# while Count # Print ("Kill you..")# count = Count + 1# Number of 1-100# count = 1# While Count # Print (count)# count = Count + 2# Let users continue to enter content and print. Exit the program until the
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