For example, 'string', "string", "" string ", or '''string '''.
There is no difference between single quotes and double quotes. The main function of the three quotation marks is to include line breaks in strings. That is to say, if the content in
I flipped through a python book and tried it at will.ProgramAn error occurred. Python 3. X and 2. x have changed some things, making beginners depressed.
1. Print has a function in 3. X and needs to be written as print (...)
2. When tkinter is
Sax is an event-driven API. Parsing XML documents using sax involves two parts: the parser and the event processor. The parser is responsible for reading XML documents and sending events to the event processor. For example, the element starts to
Use OS. Access (filename, mode ):
S.
Access
(
Path,
Mode
)Bytes ¶
Use the real UID/GID to test for accessPath. Note that most operationsWill use the valid UID/GID, therefore this routine can be used
Magic methods and attributes
------------------------
Preparations
To ensure that the class is a new type of class, you should add _ metaclass _ = type to the beginning of your module.
ClassNewtype (object): mor_code_hereClassOldtype:
'''
Created on 2011-4-30 @ Author: xuqiang''' # Open File # Open (file, Mode) # File: the file to be opened # Mode: Open File mode, 'R' the file will only be read # 'W' only writing and existing file with the same name will be erased #
ArticleDirectory
1. user input
2. Files
3. Pickle)
10. Input/Output
In some cases, you haveProgramInteract with users. For example, you need to obtain the input from the user and then output the calculation result. We can do this
Specific instance
We need to traverse the directory, including sub-directories (haha) to find all the files with the suffix rmvb, Avi, and PMP. (Day ?! What are you doing? This is my privacy ~~)
CopyCode The Code is as follows: Import OS
Def
CopyCodeThe Code is as follows: #-*-coding: UTF-8 -*-
From win32com. Client import dispatch
If _ name _ = '_ main __':
APP = Dispatch ("Et. application ")
# Minor version number
Print 'app. Build: % s' % app. Build
# Major version number
One pickleThe pickle module is used to serialize and deserialize python objects. Generally, pickle serializes a python object into a binary stream or file.
Serialization and deserialization between python objects and files: pickle. dump () pickle.
When a PC logs on to Sina Weibo, the user name and password are encrypted in advance with js on the client, and a set of parameters will be obtained before POST, which will also be part of POST_DATA. In this way, you cannot simulate POST login (such
I looked at the python FAQ these two days and found that python is more flexible than I thought. I can't try it because I don't have a practical project drill. However, Dongdong In the FAQ should have authority. Here are some of my ideas.
We know
There are three methods: one is to use the extension library win32com provided by Microsoft to operate IE, the other is to use selenium's webdriver, and the third is to use HTMLParser resolution provided by python. Win32com can obtain document
The encoding conventions provided in this document apply to the Python code that forms a standard library in major Python releases. For more information, see the description of the C code style guide in Python C implementation.
This document is
When I was backing up photos on my mobile phone recently, it was a little troublesome to perform manual operations. I wanted to write a script for automatic operation. Because some photos have been backed up before the backup, you need to make a
The pwd module is simple and used on linux/unix platforms to obtain information about the/etc/passwd file. It can be used as an interface to obtain user information. Next let's take a look at the specific usage details.Summary
The pwd module has
Reprint Please note: Small Five Yi http://www.cnblogs.com/xiaowuyi
Scapy is a powerful interactive data packet processing program written in python. It can be used to send, sniff, parse and forge network data packets, and is often used in network
My boss was unable to visit the Teaching and Research Section frequently due to busy tasks. So I asked him to build a monitoring system so that he could see the number of students in the office. O (> others
My idea was to go directly to the next
1. ACK Scan
>>>ans,unans=sr(IP(dst=)/TCP(dport=[,],flags=)
After scanning, find the unused Port:
s,r s[TCP].dport==+
Filtered:
s +
2. Xmas Scan
>>>ans,unans=sr(IP(dst=)/TCP(dport=,flags=))
RST indicates that the port is closed.
3. IP Scan
>>> ans,
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