1. Throwing Exceptions and custom exceptionsPython uses an Exception object (Exception object) to represent an exception, and an exception is thrown when an error is encountered. If the exception object is not handled or captured, the program
Introduce some common query methods of Django modelThe first is some documented help__exactexactly equals like ' AAA '__iexactexact equals ignore case ilike ' AAA '__containsContains like '%aaa%'__icontainsContains ignore case ilike '%aaa%', but for
1. Tracking program executionSimilar to Sh-xPython-m Trace--trace rsyncd.pypython-m trace--trace rsyncd.py start #也可以给脚本加参数, it is OK to run2. PDB Module debugTest code exampleImport pdb a = "AAA" Pdb.set_trace () b = "BBB" c = "CCC" final = a + B +
Collections ClassThis class is equivalent to an extension package that contains some extended operations for data types such as dictionaries, lists, tuples, and so on.1. Counter counter#计数器可以列出字符串和列表中元素出现的个数, and returned in a dictionary>>> import
Openstack Python API Learning DocumentationReprint Please specify http://www.cnblogs.com/juandx/p/4953191.htmlBecause of the need to learn to call OpenStack using the API interface, the previous article wrote some methods of using OpenStack's pure
Calculator ideas
1. Input formula required2. Whether the test formula contains letters3, if the inclusion of letters will need to re-enter, otherwise the next operation4, detection of the existence of parentheses, if there is parentheses, the
When downloading the Python third library file, some library files have EXE's release version, but some third libraries do not find executable files for window installation package is EXE file, and only the source code file is the py file, and the
Chapter One Welcome to Python world1 Python Features:Advanced interpretive language for system invocationObject orientedUpgradeable, extensible, portedAutomatic Memory Manager (memory management is the responsibility of the Python interpreter)2
requests\packages\urllib3\util\ssl_.py:100:insecureplatformwarning:A true Sslcontext object is not available. This prevents URLLIB3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see
One, cycle mechanism and application scenario1.while CycleUsed to write generic iterative structures (non-traversal);The top test executes the loop body as true, and repeats the test several times until the other statement after the loop is executed.
Official website: https://www.python.org/free installation version:portable pythonhttp://portablepython.com/wiki/portablepython2.7.3.1/ python details Benefits 1, provides a large number of inside, for you to use; 2, Linux
Python built-in function map/reduce/filter These three functions are handy, very cool.filter () function: The filter function is equivalent to filtering, calling a Bool_func (a method that returns only bool type data) to iterate through the elements
There are many ways to concatenate strings in Python, to summarize:1 the most primitive string connection: str1 + str22 python new string connection syntax: Str1, Str23 Strange string way: str1 Str24% connection string: ' name:%s; Sex: '% (' tom ', '
6. File processingRead file F=file (' MyFile.txt ', ' r ') for line in F.readlines (): line = Line.strip (' \ n '). Split (': ') print line file content written in memory buffer More than 1024 writes to the hard disk to force write to hard disk
WebDriver implementation for specific Web region methods-Python implementation, webdriver-python
1. in automated testing, there are two methods to handle verification codes:
1. Find the developer to remove the verification code or use the universal
[Original] Python Web deployment method summary, pythonweb
Do not make the server streaking
I have learned from PHP, and the official php environment deployment is very simple. Just change a few files to OK. FastCgi is also a matter of minutes. In
Python crawler tool list, python crawler list
This list contains Python libraries for web page capturing and data processing.Network
General
Urllib-network library (stdlib ).
Requests-network library.
Grab-network library (based on
Python implements the method of periodically capturing webpage content, and python webpage content
This example describes how to periodically Capture web content using Python. We will share this with you for your reference. The details are as
The first time I wrote a static webpage on Django, django wrote a static webpage.
Create a Python Django project:
Win + RGo to the cmd command interface and cd it to the specified project directory. For example, my project directory is E: \ wamp \
Connect to the database using python-set Chinese Characters in oracle and mysql,
1 import cx_Oracle 2 import MySQLdb 3 4 def conn_oracle (): 5 cnn = cx_Oracle.connect ('username ', 'Password', 'IP: Port Number/database') // user name, password, ip
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