Serialization:Variable from memory into a process that can be stored or transferredCalled pickling in Python, also called serialization,marshalling,flattening in other languages, etc.Deserialization (unpickling):Variable contents re-read from
Formatting Operators• Strings can use formatting symbols to represent special meanings%c convert into characters%s Priority str () function for string conversion%d/%i turn into a signed decimal number%o Turn unsigned octal number%e/%e turn into
SysThe SYS module is different from the OS module, which deals with the Python interpreter.SYS.ARGV: Returns the beginning of a file name with a list of what is entered laterImport sysres = Sys.argvprint (res) execution: C:\users\ldsly>python
(1) Python GUI:Python writing a simple interface is still possible. I am using TK.Simply put, just a few words can show the interface:Import tkinterroot = tkinter.tk () root.mainloop ()When adding a library, many people say the form of import
Objective: To check if the password is strong through regular expressions, this method should be used very often when registering a Web page.Environment: Ubuntu 16.04 python3.5Idea: You need more than one regular expression, and then check whether
I. The role of exception handlingThe use of Python exception handling is to handle thrown exceptions so that the code behind the program runs correctly (debug code, or program run that does not affect the overall run, an uncontrolled exception
Common Assertions
Assertlocation (judging the current is on the right page)
Asserttitle (check that the title of the current page is correct)
Assertvalue (check input value, checkbox or radio, with value "on" inaction "off")
Objective: to deal with the text, the regular expression of the function is very powerful, can be very clever filtering, matching, get the desired string, is a must learn skills, here only the usual writing, detailed documentation can be read the
Coded thinking Map:That is, the file is not encoded, in fact, in the binary format is saved in the hard disk. However, it is necessary to use the appropriate encoding to process the write read so that the operating system fits the relevant
SYS modulesys.argv command line argument list, the first element is the program itself path Sys.exit (n) exits the program, exit normally (0) sys.path Returns the search path for the module, using the value of the
in Python, the OS module and Shutil module used frequently in the file and directory operation are often use. 1. Get the current working folder, that is, the folder path of the current Python script work: OS.GETCWD ()2. Returns all file and folder
The essence of the import module is to import the code inside the module, from top to bottom to execute it againThe order of the modules to find, first from the current directory to find, can not find, then the environment variable inside to
Download the Python version of Py2exe and use this tool to package your own programs as EXE files. Use this tool to write a setup.py file for packaging (name can be self-determined, not necessarily setup.py), write well after the command prompt
In our use of Python development, it is common to use the virtualenv to isolate the environment and to prevent the local Python environment from being contaminated
When we have multiple virtual environments, how do we replicate the package of a
Class Fabric host hypervisor development:
1. Run the program to list host groups or hosts
2. Select the specified host or group
3. Choose to have the host or host group execute commands or transfer files to them (upload/download)
4. Make full use of
Install Windows10 + Python3 + BeautifulSoup4 and windows10python3
It is quite troublesome to use regular expressions to extract content from webpages. Here we will introduce a Python library that can extract data from HTML or XML files: Beautiful
Lincode record 5 and lincode record 5Course Schedule Frog Jump Maximum length of the receipt string Course Schedule
The course selection solution is a clear question: bfs or dfs, and then a dictionary optimization is added, I haven't figured it out
Python language type
Python is a strongly typed dynamic scripting language.
Strong type: adding different types is not allowedDynamic: Do not use the display data type declaration, and determine the type of a variable when it is assigned a value
Python Concatenates the full avatar of a friend and the python avatar.Full portrait of friends
Let's just talk about the code.
Import itchatimport mathimport PIL. image as Imageimport ositchat. auto_login () friends = itchat. get_friends (update =
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