One, the system library provides a library of intrinsic function number characters:
1) Str.islower (): Whether the strings are all lowercase
2) Str.isspace (): Whether the string is empty
3) Help (str): query string function library
4) str.replace (old, new): String substitution function, (can replace only part of the content)
5) Str.isupper (): Judgment is not uppercase
Mathematical functions:
Import Math: The introduction of the math library, not the default, if you want to use mathematical functions, you need to first introduce
1) Math.sin (): Seek sin30° such as Math.sin (3.14/6) Math.sin (MATH.PI/6)
2) Math.PI: To find the PI value
3) Math.pow (n,m): N's M-th square
4) * *: Several parties such as 3**4 3 4-Time Square
Operating system functions
Import OS
OS.GETCWD (): Gets the current working path
Os.listdir (current directory): Gets all the entities in the current directory (document)
Network function library: import socket
1) Get network IP address: socket.gethostbyname (' website IP address ')
2) Help (SOCKET): Query the function library under the socket
Ii. functions provided by third parties
Open source projects provide functions that need to be downloaded and installed online: httplib2 details Baidu related blog
1) Import Urllib:url class
2) Import WebBrowser as Web: Operation Browser. and alias WebBrowser to Web
3) urllib.urlopen (URL). read (); : Open browser and read related content
4) Open (' File name ', ' W '). Write (What you need to write): write the read file to the file
5) WebBrowser. Open_new_tab (' HTML file needed to open '): Open the relevant HTML file through the browser/url
Third, user-defined functions
A module or function that you write yourself
def keyword function_name (parameter):
Without curly braces, you need to use the TAB key to differentiate the block of statements.
Python function library and function standard library