Because I want to do a small project, I intend to learn a back-end language, Na Na na, I chose Python. The first is the construction of the environment:1. Download:Python official website: https://www.python.org/, version has been updated to Python3,
1. Defining functionsUse the DEF statement, followed by the function name, parentheses, colon, sometimes with arguments in parentheses, then line indent, write function body, return value with return statementFor example:def Test (x): if 0 :
One I am a dish B, slowly groping in the study.Install module PIP Install DnspythonUsing Python to invoke the Dnspython module, write a DNS attack applet, the target IP for their own DNS server, and can get the DNS flag return value, which can also
Scenario: Request Verification code Module regvc.py read the configuration file Config.ini, the regvc.py module executes normally, but the run_all.py module executes the Times error in bulk, the section is not foundWorkaround: The configuration file
Built-in functionsList listsTuple tuplesData type: int boolData structure: Dict list tuple set strReversed () reversalKeep the original list to generate a reverse iteratorSlice () can generate a slice rule, infinitely applyFormat () to set the
Virtual environments: When you need multiple versions of Django or other frameworks to develop code, you can create virtual environments pip3 install virtualenv # with Virtual environments Virtualenv virtualenv env1
Tag: Mem DMA Specifies a dot ADE TPS code to judge htmlHave to say, Python is really convenient, what to have whatAfter the automatic transmission of text messages, the mail is also ready to liveMain references:Enterprise 263 mailbox sent to QQ
What ' s the recursion? the definition of a recursive function: a function can be called again, if the function of the call is the function itself, then a recursive function is formed.The maximum recursion depth is 997, which is defined by the
1, scope-dependent1) Locals ()---------get a dictionary of local variables in the namespace where this method is executed#返回本地作用域中的所有名字2) Globals ()--Get a dictionary of global variables#返回全局作用域中的所有名字2, string-type code executionEval () executes the
Because Python is cross-platform, it can run on Windows, Macs, and various Linux/unix systems. Write a Python program on Windows and put it on Linux to run it.To start learning Python programming, you first have to install Python on your computer.
OS.GETCWD () Gets the current working directory, which is the directory path of the current Python script workOs.chdir ("dirname") changes the current script working directory, equivalent to the shell CDOs.curdir Returns the current directory: ('. ')
character
meaning
.
Represents any character that matches except for a line breakNote: By setting up re. Dotall flag can be made. Match any character (including line breaks)
|
A | B, indicating A or
Python file type source code
Python source files with "py" extension, interpreted by the Python program, do not need to compile
BYTE code
Python source files are compiled with a file with the extension "PYc"
Compilation methodimport
Reprinted from: https://www.cnblogs.com/code123-cc/p/4822886.htmlRecently when using Python to do projects, you need to convert Chinese characters into corresponding pinyin. A ready-made program was found on GitHub.Python kanji to PinyinExamples of
With the keyword yield, you can generate a value from the generator and return it. We can use the generator as a producer .In the process, by using the keyword yield, you can also let a program with yield receive values. At this point the function
Python programming pygame module implements the mobile car sample code, pythonpygame
Pygame is a cross-platform Python module designed for video games, including images and sounds. Based on SDL, real-time e-game R & D is allowed without being bound
Python practice = build an FTP service with python code, and use pythonftp
Environment setup:
Python
Windows/linux
Pip install pyftpdlib (Installation failed Please download here: https://pypi.python.org/pypi/pyftpdlib)
One line of code:
Run it
Looking back at 2017, looking back at 2018, and looking back at 2017, looking forward to 2018I. Let's take a look at my goal for this year, which I set last year. 1. salary. I don't need to say that. 2. If I change to another field, I have many
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