Install PythonPython environment: Python 3.6.5Installing Cx_freezePip Install Cx_freezeCreate setup.pyCreate a setup.py file in the Py file sibling directory that needs to be packagedImport sysimport osfrom cx_freeze Import setup,
Let me introduce you to the anonymous function in Python today.anonymous functions
lambdadefined by keywords
Parameter list does not require parentheses
The colon is not the opening of a new statement block.
Can only be written
Please use code to implement:A. Using underscores to stitch each element of a list into a string, Li = "Alexericrain"test="alexericrain"v='_'. Join (Test) Print (v)Operation Result:A_l_e_x_e_r_i_c_r_a_i_nB. Use an underscore to stitch each element
SYS module features many, we introduce some of the more practical features, I believe you will like, and I went into the Python module it!A list of common functions of the SYS module
sys.argv: Implements passing parameters to the program
1. NamespacesA. Global namespace (namespace): When you run a program, the corresponding relationship of the memory address of the variable to the value, excluding the function.B. Local namespace: In the case of a function, the function name exists
Practice Code:(1) https://gitee.com/pythonbigdata/pythonTest01/blob/master/Test/Def.py (use of variable functions, and three function big data needed in big data)(2) https://gitee.com/pythonbigdata/pythonTest01/blob/master/Test/Class.py (use and
Using the Tushare library, he has a function that reads whether all dates are open and the return value is Dataframe typeimport tushare as tsts.trade_cal()IsOpen 1 is the opening.The full source code is as follows:import tushare as tsimport
1. __init__.py defines the properties and methods of the packageGenerally empty file, but must exist, no __init__.py indicates that his directory is not a package2. When importing the package, useFor example, there is a test directory with xx1.py,xx2
SYS module features many, we introduce some of the more practical features, I believe you will like, and I went into the Python module it!A list of common functions of the SYS module
sys.argv: Implements passing parameters to the program
In the original file for partial content substitution, mainly use the Seek () function and truncate () function implementation, directly on the code:# coding:utf-8 import re Path = ' c:/users/lenovo\desktop/20180514152829/cache/576996ede1ef5126
One: Python basics1. File suffix name:. py2, Python2 to read Chinese in the file header write:-*-coding:utf8-*-3. Input uses n as a variable, substituting a value for a changen = input (' Enter user name: ') waits for the user to enter a value, the
Bubble sort (Bubble sort)22 compares the keywords of adjacent records if the inverse is exchanged until there is no reverse order.1. Algorithm Description:
Compares the adjacent elements. If the first one is larger than the second, swap
SYS module features many, we introduce some of the more practical features, I believe you will like, and I went into the Python module it!A list of common functions of the SYS module
sys.argv: Implements passing parameters to the program
Python3 vs. C # basic syntax: https://www.cnblogs.com/dotnetcrazy/p/9102030.htmlUsually use timing reminders to improve work efficiency, to the Linux .... Mongolian Circle, the previous C # can't cross the platform ah, so there is this article ~
I. Inheritance of classesCases: import Random as R Class Fish (): def __init__ (self): Self.x=r.randint (0,10) Self.y=r . Randint (0) def move (self): Print ("Position now:", SELF.X,SELF.Y) Class Goldfish (Fish): Pass Class Shark (Fish):
Adorner: Essentially a function (decorating other functions): Adding ancillary functionality to other functions.Principle:
Cannot modify the source code of the decorated function
Cannot modify the calling method of the decorated
SYS module features many, we introduce some of the more practical features, I believe you will like, and I went into the Python module it!A list of common functions of the SYS module
sys.argv: Implements passing parameters to the program
Leetcode Address: https://leetcode.com/problems/maximum-gap/description/Title DescriptionGiven an unordered array, find the maximum interval between the sorted elements.It is required to be implemented with linear time complexity.For example: 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