The problem with Pickle is the same as for all other programming language-specific serialization problems, that is, it can only be used in Python, and may be incompatible with each other in Python, so it's okay to save only those unimportant data
Os.path.exists ('/data ') determines if the directory and file exist and determines whether the current path existsOs.path.isdir ('/data ') to determine if it is a directoryOs.path.isfile ('/data/1.txt ') to determine if it is a fileOs.access
Chapter II List and tuples1. Data structure: a way of assembling elements together.6 built-in sequences of 2.python: list , tuple , string ,Unicode string , buffer object, Xrange object.3. Iteration: repeats an action on the elements of the sequence
1. Multi-File Project Walkthrough
Development Projects are the development of a software specifically designed to address a complex business function
Typically, each project has a separate and exclusive directory for all project-related
Hanoi Tower ProblemInitial state:thinking: When the number of plates is 3 , we write the moving orderSteps to move:3 plates, from a to c1, front two plates, from a to b1) put the front plate from a to cA->c2) Take the second plate, from a to bA->b3)
When we write case, if the operation of use cases is the same, the parameters are different, for example, to test a login interface, to test the normal landing, the blacklist user login, account password error, and so on, in the UnitTest will write
Python Base language annotations单行注释:#多行注释:‘‘‘ ‘‘‘ 或 """ """Digital整型(Int)- 通常被称为是整型或整数,是正或负整数,不带小数点。长整型(long integers)- 无限大小的整数,整数最后是一个大写或小写的L。bool(布尔型) true false浮点型(floating point real values)- 浮点型由整数部分与小数部分组成,浮点型也可以使用科学计数法表示(2.5e2 = 2.5 x 1
0. What is a collection?A collection is an unordered, non-repeating combination of data, and its main functions are as follows:
Go to the weight, turn a list into a set, and then automatically go heavy.
Relationship test, test the
What is an adorner?
Adorner Knowledge point Matting (function is variable, higher order function, nesting function)
Adorner example with no parameters
Example of adorner with parameters
Homework
First, what is an adornerIn
---restore content starts---Program exception: The program terminates after an error. Exception handling combined with:L = ['Create a teacher','Create a school'] whileTrue:Try: forNum,iteminchEnumerate (l,1): Print(num,item) Index=
1.Urllib.request.urlretrieve can download files based on the URL of the file:#-*-Coding:utf-8-*-from urllib.request import urlretrievefrom urllib.request import urlopenfrom BS4 import BeautifulSo uphtml = Urlopen ("http://www.pythonscraping.com/")
Data analysis using Python--ipython one, ipython some common commands1.TAB Auto-complete2. Variable +? Show related information3. Function name +?? The code that can get the function4. Use the wildcard character * NP. load?5.%run + file name. PY can
Underlying data typeInt : CalculationMethod:Bit_length () converts 10 bits to the minimum number of bits in the binaryBoolean :True , FalseString : Storing small amounts of dataIndexSliceStepString common operation function Method:Capitalize()
Program: Shopping Cart ProgramDemand:
After you start the program, let the user enter the payroll, and then print the list of items
Allow users to purchase items based on their product number
After the user selects the product,
One, the read operation of the fileExample 11 f = open (' learning ', encoding='utf-8') #首先要打开文件 , or read directly, is not readable 2 data = f.read () #read后的括号里不添加任何东西 3print( Data)4 f.close () #读取完了后一定要记得关闭文件, otherwise the
4. Basic use of Variables 4.1 variable definition
In Python, each variable must be assigned before it is used, and the variable will be created after the variable is assigned .
The equals sign (=) is used to assign a value to a variable
This article mainly introduces the Pycharm editor skills of the automatic import module, and now share to everyone, but also to make a reference. Come and see it together.
We often inadvertently use some of the classes and modules that have not yet
This article mainly describes the Python file read and write operations, read data from the file operation method, this article through the combination of examples of text to introduce you very detailed, the need for friends can refer to the
This article mainly describes the Python implementation of the same folder to merge all the PDF files, including Python for the PDF file read, judge, decrypt, write merge and other related operations skills, the need for friends can refer to the
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