Write a very simple script, the function is to write the daily log classification to the specified folder.
Write today's log in my.txt every day, and then save it to a specified folder with a time name
Import shutil
import OS
import Time
class
When you request a key that is not in the Dictionary object, Python throws an exception keyerror.
If you do not want to throw an exception but instead provide a default value when there is no corresponding key, you can use the Dictionary object's
Most importantly, we don't call the __init__ method specifically, but when we create a new instance of a class, we put the parameter packageEnclosed in parentheses followed by the class name to pass to the __init__ method. This is an important part
The PIP in Python is an official source, and it is very slow to install the PIP at home, so it is best to replace it with the source address in China.
Domestic PIP Mirror Source
Tsinghua: Https://pypi.tuna.tsinghua.edu.cn/simple
watercress:
Copyright Notice
Please respect the original works. Reprint please keep the article integrity, and in the form of hyperlinks to the original author "Tingsking18" and the main site address, convenient for other friends to ask and correct.
The
The first problem encountered:
Python error:unable to find Vcvarsall.batSolution, the direct installation of the compilation of good;Download Link:The second problem encountered when Http://www.voidspace.org.uk/python/modules.shtml#pycrypto was
Greed and non-greedy mode affect the matching behavior of the subexpression modified by the quantifier, and the greedy pattern matches as much as possible under the premise that the whole expression matches successfully.
Instead of greedy, the
Log is the journal, usually the system or some software to the completion of some of the processing of the record, so that the future as a reference, it does not have a fixed format, usually a text file, you can open the Notepad to view the content,
1 Python provides a variety of process communication methods, mainly queue and pipe in two ways, queue for multiple processes to achieve communication, pipe is two processes of communication 1.1 queue has two methods:
Put method: To insert
Adorner:1 Import Time2 defcal (L):3Start_time=time.time ()4res=05 forIinchL:6Time.sleep (0.1)7res+=I8Stop_time =time.time ()9 Print('the run time of the function is%s'% (stop_time-start_time))Ten returnRes One A Print(Cal (range (100)))
List type of data structureList descriptionadd element to ListTo delete a list elementChange list elementsView list elementsList script operatorsList interception and splicingNested listsList built-in functionsI. Description of the listThe sequence
# server.pyimport socketimport threadingimport times = socket.socket(socket.AF_INET,socket.SOCK_STREAM)s.bind(('127.0.0.1',9999))s.listen(5)print('Waiting connection...')def tcp_link(sock,addr): print('Accept new data info from %s:%s...' %addr)
Read the catalogue:Section I: Programming basics1. Procedure:A set of instructions that the computer can identify and execute2. Modern computer structure system-von Neumann architectureThe CPU is composed of an arithmetic device and a
2.4 Yuan zu tupe.Tuples are called read-only lists, where data can be queried but cannot be modified, so the slicing of strings also applies to tuples. Example: ("A", "B", "C")List of 2.5 lists.The list is one of the underlying data types in Python,
Simple DemoTo view supported mouse eventsPrint for inch if ' EVENT ' in i]All mouse event callback functions have a uniform format, and their different places are only functions that are called after.Then double-click the place to draw a circle:#-*
Get pixel values and modify# gets the pixel value of the specified coordinate img[i, j]# modifies the pixel value of the specified coordinates img[i, j] = [R, G, b]NumPy is an optimized package for fast matrix operations.Therefore, it is not
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