Two weeks three sessions (October 25)1. Learn Python's special indentation and syntaxPython Indents and colonsPython is so simple, thanks to his indentation mechanism, the strict indentation mechanism makes the code very neat and tidy, pleasing to
Http://anandology.com/python-practice-book/iterators.htmlProblem 1: Write an iterator class reverse_iter , which takes a list and iterates it from the reverse direction.::>>>It=Reverse_iter([1,2,3,4])>>>it. Next()4>>> it. Next()3>>> it. Next()2>>>
I follow the book, summarize the implementation to record, do not feel simple to try, knock a code. Executive power is the sword of a good programmer. If you are a novice in mastering other language situations such as Java, C or PHP and so on any
One, the use of Python version of the machine1. This machine uses Python version as 3.6.2,windows system.Second, installation steps1. Start-run-cmd2, python3.x need to enter the Python installation location is the PIP directory, and then execute the
Introducing the Python Compiler1.linux under:Generally use VI or vim to compile directly to the. py suffix file, use VI need to search for Vim Python auto-complete to facilitate our writing.2.windos under:(1) Use submit to choose Python type to
Describecos () returns the cosine of the arc of X.GrammarThe following is the syntax for the Cos () method:Import Mathmath.cos (x)Note:cos () is not directly accessible, you need to import the math module, and then call the method through the math
1. Date output formatted datetime/= stringImport datetimenow = Datetime.datetime.now ()Now.strftime ('%y-%m-%d%h:%m:%s ')Output' 2015-04-07 19:11:21 'Strftime is an instance method of a DateTime class.2. Date Output Formatted string = DateTimeImport
I. List resolution (list push-down):Function: is to provide a convenient list creation method, so the list parsing returns a list.LST = [1, 3, 5, 8, 10]ll = [x+x for x in LST if x Print LL>>>[2, 6, 10]two. Dictionary parsing style:DIC = {' A ': 1, '
Selenium2+python's environment is mainly built on Python and selenium.1.pythonThe Mac comes with Python and can view the version. Of course, you can choose to install other versions of Python.2.seleniumInstall with sudo easy_install selenium in the
Item Series __slots__ method __next__ and __iter__ implement iterator destructor context Management Protocol meta-classThe Item series simulates the object manipulation properties into a dictionary format.Example: Object name [' key '] = valueClass
The source code is as follows:1Rom Scapy.allImport*2 ImportThreading3 ImportArgparse4 ImportLogging5 ImportRe6 7Logging.getlogger ('Scapy.runtime'). SetLevel (Logging. ERROR)8 9 defparse_ip (targets):Ten " " One resolves IP segments in 192.168.1.
Python paramiko module implements remote control and transmission. For example, pythonparamiko
This article describes how to implement remote control and transmission in the paramiko module of python:
1 Installation
sudo pip install paramiko
2 ssh
Python logging library usage summary, pythonlogging
Preface
Recently, due to work requirements, it is very low to write some python scripts and print is always used to print information. So I took the time to study the python logging library, let's
Get all the URLs of the Django project and the Django project url
When adding permissions to a project, you may encounter a problem: setting permissions for all the URLs of the project, but it is too troublesome to enter permissions manually one by
Python Module 2: python Module
10 common modules:1> OS module:OS. getcwd (): Get the current working directory, that is, the directory path of the current python script;OS. chdir ("dirname"): change the working directory of the current script, which
CMDB Management System for the National Day holiday (I), cmdb for the National Day holiday
Server
The views code is transferred to plugins/_ init __to create a plug-in management PluginManager class.
Disk information plug-in pluggable
Use of itertools library in Python standard library, pythonitertools
Preface
Because there have not been many things recently, I want to write some technical articles to share with you, and also sort out the knowledge that I have accepted for a
Python file operations and examples,
Python file operations and Examples
I. File Operations
1. File Operation Process
Open the file, get the file handle, and assign it to a variable.
Operate a file using a handle
Close file
The existing
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