There are a number of useful tools classes in the Python standard library, but when used specifically, the standard library documentation does not describe the details of the usage, such as URLLIB2 this HTTP client library. Here's
object is the ISO 8601-style string: "Yyyy-mm-dd hh:mm:ss", the milliseconds are optional and can or may not be.The datetime type provides another format method, including a highly versatile strftime method (which can be seen in more detail in the time module).import datetimeimport timenow = datetime.datetime.now()print nowprint now.ctime()print now.isoformat()print now.strftime("%Y%m%dT%H%M%S")$ python datetime-example-3.py2003-08-05 21:36:11.590000
Vamei Source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!Under the operating system, the user can manage the files through the commands of the operating system, referring to the Linux file management related commands. The Python standard library allows us to manage files from within
Python standard library: built-in functions callable (object), pythoncallable
If the object parameter is an object that can be called, True is returned; otherwise, False is returned. However, it should be noted that when an object can be called, it does not mean that the execution will be successful when the object is called, but it will not be successful when th
Introduction:Doctest is a standard library for testing in Python. This library is used to simulate console dialogs to detect correct values.As the name implies, this module is looking for a part of the program inside a python interactive interpreter, and then running this se
.
SetName ( name )
sets the thread name.
The name is a string that is used for identity purposes only. It has no other effect. Multiple threads can take the same name. The initial name is set by the constructor function.
IsAlive ()
returns whether the thread is active.
In general, the thread is considered active from the start () call to the point where its run () method aborts t
Import SysPrint (Sys.path) #python 2 error ... . , the absolute path is printed (***\\python\\lib\\site-packages# Third-party library, fallback level for standard library)"Import OSOs_sys = Os.system ("dir")Print ("---->", Os_sys) #执行命令, do not save resultsOs.popen ("dir").
Summary of the usage details of the Python standard library urllib2, pythonurllib2
There are many practical tool classes in the Python standard library, but the detailed description of the use is not clear in the
1. Command-line Parameters SYS.ARGVLet's start with the example in the first part of the Python language module and see what's in the SYS.ARGV.1 # Filename:using_sys.py 2 Import SYS 3 4 i=05 for in sys.argv:6 Print ('sys.argv[%d]:%s'%(i,item))7 i=i+1Output:$python using_sys.py-param1-param2-param3sys.argv[0]: using_sys.pysys.argv[1]:-param1sys.argv[ 2]:-param2sys.argv[3]:-PARAM3Do you think that under
Python comes with a lightweight relational database, SQLite. This database uses the SQL language. As a back-end database, SQLite can be used with Python to build websites or to create tools with data storage requirements. SQLite also has a wide range of applications in other fields, such as HTML5 and mobile. The sqlite3 in the Python
Python built-in standard library socketserver module, pythonsocketserver
The socketserver module simplifies the compilation of network server tasks and encapsulates some operations to a large extent. You can think of it as an event-driven design, which is quite good. It defines two basic classes: server class BaseServer and request processing class BaseRequestHan
Python provides four basic data structures: list, tuple, dict, and set. However, when processing large amounts of data, the four data structures are obviously too single. for example, the efficiency of inserting a list as a one-way linked list in some cases is relatively low. sometimes we also need to maintain an orderly dict. At this time, we need to use the collections package provided by the Python
Vamei Source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!I'll start with the regular expression of Python's standard library. Regular expressions are a common tool in word processing and do not require additional system knowledge or experience. We will explain the system-related packages in the back.The primary function of regular expressions (regular expression
we are already inPython
The most basic mathematical functions of python are seen in the operation. In addition,
Math Package
added a lot ofFunction
. Of course, if you want more advanced math features, consider choosing a standard library
NumPy
and the
scipy
projects, they not only supportArray
and matrix operations, as well as a wealth of mathematical and physic
Python mainly uses the standard library threading package to implement multithreading.Today, the Internet age, all servers you will receive a large number of requests.The server will take advantage of multithreading to handle these requests in order to improve the read and write efficiency of the network port.Python It is a Web server background working language
Python standard library collections package usage tutorial, pythoncollections
Preface
Python provides four basic data structures: list, tuple, dict, and set. However, when processing large amounts of data, the four data structures are obviously too single. For example, the efficiency of inserting a list as an array is
In the Loop object and the function object, we understand the function of the loop (iterator). A loop is a container for an object that contains multiple objects. By invoking the next () method of the Loop (__next__ () method, in Python 3.x), the loop returns an object in turn. Until all objects are traversed, the loop will cite stopiteration errors.
In the for-I in iterator structure, each returned object of the loop is given to I until the loop end
[Python] standard library json formatting Tool
During this period of time, the tasks are messy, some time is being done for O M, and some time is being done for development. It is always too anxious and I always feel that many tasks are not very satisfactory. We still need to calm down and think about it. We need to spend more time improving, restructuring,
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.