Basic Open Mode
Process of file operation: Open file, manipulate file, close file
Open File Method: Open (file name, mode, encoding)
File = open (' file name ') mode defaults to read-only if no value is given, and the absolute path
#-*-coding:utf-8-*-#Test company mail system weak password, fromEmail.mime.textImportMimetextImportSmtplib#Weak password dictionaryPasslist = ['***','***123','abc123','123456']#User ListUserList = ['DS','FF','FD','F','FS']#set the mailbox suffix and
Basic built-in functionsSupplemental built-in functions:1, callable () #判断 (function) can be executed or called, this function returns a value of Ture or False def F1 (): Pass print (callable (F1)) 2, Chr () #把数字转换成ASCII字符 Print (Chr (65)) 3, Ord ()
Built-in functions# Whether the callable object can be called def F2 () :pass'xxx ' Print (Callable (F2), Callable (F3))==> True False # function can be called, string cannot be called # CHR gives an index position, based on the given
Toss the tkinter in PythonSee a brief introduction to Python tkinter from Oschina:TK Graphical user interface TkinterAlso from the Python website documentation:Tkinter-python interface to TCL/TK, I know that Tkinter is built into Python.I'm going to
Turn from:Http://cuiqingcai.com/927.htmlA summary of the introduction of»python crawler in static searchingFirst, what is a reptile?Web crawler (also known as Web spider, Network robot, in the middle of the foaf community, more often called the Web
1. Print a stringPrint " I ' m%s " % ("jihite") I'm jihite2. Printing integersPrint " I ' m%d years old " % (+) I'm years old3. Print floating-point numbersPrint " π=%f " % (3.1415926) π=3.1415934. Print floating-point numbers (Specify the number of
The main contents of this section:1. Built-in functions left in the previous section:Callable (), Chr (), Ord (), compile (), eval (), exec (), Divmod (), Isinstance (), filter (), map ()2. Decorative Device(a) Built-in function supplement:Callable (
Nowadays, Python 3 is becoming + and more popular than Python 2, but there was still a lot of codes of Pyt Hon 2 remained. Although we can use them on Python 2 or with pyenv to manage the versions of Python, but I still want to modify th ESE codes
18. python exception handling, 18. python exception handling
Python contains at least two types of errors: syntax errors (Syntax errors) And exception (Exceptions).
1. Syntax Error
Syntax errors, also known as parsing errors
The syntax analyzer
Python Encoding Problems, python EncodingSCII encoding is one byte, while Unicode encoding (Chinese characters) is usually two bytes. One byte, 8 bits)If Unicode encoding is used, English letters occupy 2 bytes, resulting in a waste of space. As a
Use python to generate a bat script file for exporting the database,
# Environment: python3.x def getExportDbSql (db, index ): # obtain the SQL statement SQL = 'mysqldump-u % s-p % s-h % s-P % d -- default-character-set = utf8 -- databases mu_ins_s
Python decorators are easy to understand, while python decorators are easy to understand.
The functions and names of the decorator are different in many languages. In fact, it represents a design model and emphasizes the principle of openness and
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