Python learning notes day5-common module learning and python learning notes day5
I. Main Content
Ii. Details
1. Module
A. Definition: the essence is the python file ending with. py. It logically organizes python code to implement certain functions.
Detailed explanation of the OS module in python and the pythonos Module
The OS module allows you to create, delete, and view file attributes for directories or files, as well as perform path operations on files and directories. For example: absolute
Access ParametersYou can use process. argv to access the command line parameters. It is an array containing the following content:[NodeBinary, script, arg0, arg1,...]That is to say, the first parameter starts from process. argv [2]. You can traverse
Common Python modules (OS module) and pythonos ModuleI. Introduction to the Python OS Module
The OS module is a Python System Programming operation module that can process files and directories.You can view the help documentation of the OS module:
System Analysis
Through the above analysis and instructions, the reader has basically learned how to customize the jsp http server that he needs. However, the characteristics of the jsp http server system may be vague. Here we will analyze the
Zend Framework + smarty usage examples, zendsmarty
This example describes how to use Zend Framework + smarty. We will share this with you for your reference. The details are as follows:
I. Introduction to Zend Framework
Zend Framework uses the Model-
4. File: a traditional I/O Stream storage File. Activity provides the openFileOutput () method to output data to a File, the specific implementation process is the same as saving data to a file in the J2SE environment. The following example shows
Writing and reading PHP files (read only ),
Article outline:
I. Basic Ideas for reading and writing files
Ii. Use the fopen method to open a file
3. File Read and Write operations
4. Use the fclose method to close the file
5. Movement of file
Configure the Vagrant environment in Windows
Vagrant is a Ruby-based tool used to create and deploy a virtualized development environment. It uses the open-source VirtualBox virtualization System of Oracle.
Vagrant is very good at setting up a
OS module, pythonos Module
OS. getcwd () obtains the current working directory, that is, the operating directory path of the current python script. chdir ("dirname") changes the current script working directory, which is equivalent to cdos in shell.
Description of common functions of the Python OS module, and functions of the pythonos Module
The OS module in the Python standard library contains common operating system functions. This module is especially important if you want your program to be
Use getfattr in bash shell to View File Extension attributesGetfattr is used to obtain extended attributes of a file and return a series of key-value pairs. For details, refer to Linux Man Page. Common OPTIONS
-n name, --name=nameDump the value of
I. Data storage File:
In android, you can create a file to save data on the storage device of the device or an external storage device. By default, files cannot be shared among different programs.
Context in android provides several methods for file
One of the examples in "Java and mode" uses system. getproperty (string key)
System.getProperty("user.dir");
It's strange how he knows that the key is "user. dir ". Baidu has been sticking these keys for a long time. But where to find it? It took
File and input/output
Object
Generic file objects: objects with file-type interfaces, such as files, Web pages, and communications. A file is a continuous byte sequence. Byte streams are often used for data transmission.
Open ():
A. Regular Expressions:Metacharacters is a character used to illustrate the meaning of a character expression, in short, a character used to describe a character.The regular expression re (Regular expression) is a string of characters consisting of
See the bird's-brother Linux private Dish*-wildcard character, which represents random characters (0 for many)? -Wildcard, which represents a character#-Gaze/-Jump symbol to restore special characters or wildcards to a general symbol| -demarcation
the system organization of Linux is--the whole system starts from the root, according to the tree-shaped directory downward gradually expand, classify and store different uses of the file,/read as a "slash", English slash; when it writes a path, the
Python has a lot of common modulessuch as the log module loggingCall Log Moduleimport loggingLevel high and low order: DEBUG Default to start printing after warning contains warningIf you want to print the full, you can adjust the default
About the bird's Linux private dishes*-wildcard character, representing random characters (0 to more)? -wildcards, which represent one character#-Gaze/-Jump symbol to restore special characters or wildcards to a general symbol| -demarcation of two
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.