Os.path module is mainly used for file property acquisition, which is often used in programming, the following are several common methods of the module. More ways to see the official documents:
tuple tuplesWhy do I need tuples ?For example : Print the user's nameUserinfo1 = "Fentiao 4 Male"Userinfo[0:7]Conclusion : The method of extracting name / age / Gender in the string is inconvenient , the birth tuple .First, definition of tuples(
A brief history of Python? 1989, Guido (Uncle Turtle) python.? 1990, release the first version of Python;? 2001 release of the python2.0 version;? 2010 Annual Tiobe Programming Language Award? 2013 release of the python3.x version;python appPython
1.if usage Examples:If statement:If expression:statement (s)Note: Python uses indentation as a method of grouping its statements, and it is recommended to use 4 spaces.(1) The condition is true (non-empty amount (string,tuple,list, set,dictonary),
Tag: Represents strong time () FFFFFF time using 2.0 Lin PtimeImport Time ()• Get local time:Time.time () #本地时间的时间戳格式.1514273633.0474658Eg:int (Time.time ()), int (time.time () *1000) #本地时间的时间戳格式的秒级和毫秒级别Time.localtime () #本地时间的元组形式.Time.struct_time (
---restore content starts---1. Collection creationThere are two ways to create a comparison list, a tuple, a dictionary, and only one way to create a collection 1 s = set ("Alex Li")2. The collection object is a set of unordered, hashed values---the
Open File #Specify the file path ' filename.txt ', you can use the absolute path and the relative path #mode= ' W ' specifies how files are opened #encoding= ' utf-8 ' Specify file encodingf = open ('filename.txt', mode='W', encoding='Utf-8'
Modules and PackagesBefore you know import, there are two concepts to mention:
Module: A .py file is a module
Package: The __init__.py directory where the file is located is the package
Of course, this is only a minimalist version
I. Introduction to the processing of documentsThe computer system is divided into three parts: the hardware, the operating system and the application.Applications that we write in Python or other languages need to be saved on the hard drive if we
Fast sorting is fast, probably thinking is: First use a numeric value as the median, by first sorting the array into two parts, the left is smaller than this value, the right is larger than this value, and then use recursion to the two parts of the
I. Introduction to the processing of documentsThe computer system is divided into three parts: the hardware, the operating system and the application.Applications that we write in Python or other languages need to be saved on the hard drive if we
We already know that there are several types of data that can be directly applied to a For loop:A class is a collection of data types, such as list, tuple, dict, set, str, and so on;A class is generator, including generators and generator function
Today's content:-------------------------------------------? Code indent with Colon? Blank line delimited Code snippet? Naming conventions for packages and modules? Naming conventions for classes, objects? Naming conventions for functions? Code
First, Python simple use1. Simple program WritingPrint ("Hello world!")Name = "Laogui Lv"Print ("My name is", name)Complete the first program, Hello World to formally enter Python learning2. Variable assignment and variable outputThe code in "" can
variablesA variable is an area in memoryThe name of a variable: A number that consists of letters, numbers, underscores, and cannot begin withThe address variable in Python is the opposite of the C language, and a single piece of data contains
The topic is derived from : http://www.liujiangblog.com/blog/7/1. The following three options which are True
5+4j > 2-3j TypeError: Complex number can be compared to size (refer to: Know link)
' abc '
(3, 2) STR cannot be larger
Basic Computer Knowledge:1. Windows32 bit system, use maximum memory is 4g,64 bit system use 128G2.windows Computer Application Call process display read hard disk data, load into memory, CPU every time from memory to fetch data, power loss memory
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