1. Basic file operation
Open () Opens or creates a file
Format: Open (' file path ',' open mode ') return value: File IO object open mode altogether n kinds: W-mode write mode when the write file does not exist when the file
Save the. py file Sublime edited locally, enter it in the current directory1 python hello.pyWhere the cmd black window has so few shortcut keys,C: Enter another diskDIR Displays the current directorytab for code completionEntering Python directly
What is recursion?Recursion is a type of function that executes in a pattern similar to the end-to-end snake.Count = 0def func (): Global count = count + 1 Print (" I'm a little handsome%s"%count) func () func ( )# Output I'm a
Original address: http://www.cnblogs.com/juandx/p/4962089.htmlPython reads and writes, creates filesThe operation of files, folders (file manipulation functions) in Python involves both the OS module and the Shutil module.Get the current working
One. Re moduleRegular expressions when a concept of computer science, regular expressions are often used to retrieve, replace those that conform to a pattern of text, most programming languages support the use of regular expressions for string
Simple carding unittest Unit test frameworkWhat is unit testing? Unit testing is about detecting your own code.Code min--Class, function, composition, the ultimate goal is to detect whether the function is working properly1. Import the UnitTest
1. Package:Defined:Split multiple values in parentheses, grouped togetherEssentially, a tuple is returned, but the parentheses are omitted# Package Narimoto Group! T = (2)3 in [+]: T4 out[100]: (1, 2, 3)1 A = 42 b = 53 tmp = a4 a = b5 b = tmp6 c9>
The UUID is a 128-bit globally unique identifier (Univeral unique identifier), typically expressed in the form of a 32-bit string. Sometimes also called a GUID (Global unique identifier). Python has its own UUID module for the generation and
1. How to find two pointsFind the fastest speed for a sorted list2. Code implementation(1) Recursive implementationdefBinary_search (Alist, item):ifLen (alist) = =0:returnFalseElse: Midpoint= Len (alist)//2ifalist[midpoint]==Item:returnTrueElse:
1, run-time plus-u parameters, such as # python3-u test.py >> Test.log &View Python's-u parameter with man, as described below:Force stdin, stdout and stderr to be totally unbuffered. On the systems where it matters, also put stdin, stdout and
After learning C language and C language data structure and algorithm to learn python, feel that the core content of programming has not changed, but each programming language has its own characteristics. The goal of this study is to understand the
1. Running Cmd--regedit2, find ' hkey_classes_root\systemfileassociations ', click Open Folder, look down to see if there is '. Py ' folder3, directory search . py, if not, create a new item . Py-->shell-->edit-->command4. Create the item in turn,
Function: A functional, reusable statement group definition function: def (): return function definition The parameter specified is a placeholder and can be omitted When defining a function, you can specify a default value for some parameters,
Reference Links:Use of BS4 and requests: https://www.cnblogs.com/baojinjin/p/6819389.htmlInstalling pip:80293806#Python 3.x began to bring the PIP, if not please confident Baidu installed. #pip install BEAUTIFULSOUP4 requests
# class is also an object# All Objectsclass Person (object):num = 0Print ("--person--test--")def __init__ (self):Self.name = ' abc '#--person--test--Print (100)# 100Print ("Hello")# HelloPrint ("TT")# TTPrint (person)# # Dynamic creation of
principleImplementation process:The character color of terminal is controlled by escape sequence, and it is the system display function in text mode, which is independent of the specific language. The escape sequence begins with the ESC, which is
python Regular Expressionsis a special sequence of characters that can help you conveniently check whether a string matches a pattern, and this article will
python Regular ExpressionTell you
Regular ExpressionsThere is a lot of use in Python because
Presumably everyone is just beginning to touch the Python programming language, so there is no contact with the date and time in Python. So there's some confusion about how to get the current year and day and time, like how
Python gets the present
This article we look at from the socket programming example
Python Asynchronous FrameworkHow it works, you need to understand the simple socket programming and the I/O multiplexing mechanism provided by Linux.
Python Asynchronous FrameworkIt is also
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