1 Creating a table in MySQL1) Start MySQL#service mysqld Start2) Create a project#django-admin.py Startproject web_043) Create an app#cd web_04#django-admin.py Startapp Blog4) Create a new database#mysql –u root–p (with password)#mysql –u root (no
The Configparser is a Python-brought module used to read and write configuration files.
A specific format:1 # Note 1 2 ; Note 23 [Node1] # node 4 key1=value1 # key value 5 ... 6 7 [Node2] ; node 8 key2=value2; node 9 ...formatUsage:1
1 Flow Control If...else statementsSingle Branchif 条件: 满足条件后要执行的代码Dual Branchif 条件: 满足条件执行代码else: if条件不满足就走这段= 48if AgeOfOldboy > 50 : print("Too old, time to retire..")else: print("还能折腾几年!")Indent in
This indentation must be
We know we can write this when we manipulate the file object.With open (' A.txt ', ' R ') as F: codeThe above is called the context Management Protocol, the WITH statement, in order for an object to be compatible with the WITH statement, the
1. What is the difference between a method and a function?" " class Foo (object): def __init__ (self): self.name = ' Alex ' def func: print (Self.name) from Types Import functiontype,methodtypeobj = Foo () print (Isinstance
Urllib basic usage of sending requestsThe basic usage is to invoke the request library,class urllib.request.Request(url, data=None, headers={}, origin_req_host=None, unverifiable=False, method=None)It's OK to fill in these property values into the
One: File Savedef save_to_file (file_name, contents): fh = open (file_name, ' W ') fh.write (contents) fh.close () save_to_ File (' Mobiles.txt ', ' your contents str ')Results:Modify string to overwrite the original stringReplace a string
Dictionary: Format: dict{}Data type partitioning: variable data types and immutable data types Variable data type called: can Hashion group bool int STR Immutable data types are called: Non-Hashiru: list bict SetDict key: Must be a immutable
# Example 1: There are 1, 2, 3, 4 digits, which can make up the number of different and no duplicate number three digits? How much are they? for in range (1,5): for in range (1,5): for in range (1,5): if and and (j!=k):
Python variable,
Python variable: stores information and data for future use and modification.
1. python is case sensitive
2. variables can only consist of letters, numbers, and underscores. They cannot contain spaces, special characters, or
Install Python2/Python3 and win10python2 on win10 at the same time.
How to install python2 and python3 simultaneously on win10?
To meet the daily work or learning needs, we may often use python2 and python3. Below are some tips for installing two
Crawling sister images (requests + BeautifulSoup ),
--- Restore content start ---
Just getting started with crawlers, today we will first crawl a single gallery and then crawl pages in a few days.
Use the requests library and BeautifulSoup
What should I do after getting started with Python ?, Introduction to Python
More than once, zhihu's readers ran to ask: after reading the basic book or even reading it twice, I still had no idea when I wrote it. What should I do?
In my opinion,
Use python + selenium in windows to open firebox and pythonfirebox
Install selenium through pycharm
1. Configure python and pycharm, open pycharm, click File> Setting> Project Interpreter in the upper left corner, and click Add on the right.
2. In
18.3.5 python definition of variables, 18.3.5python
The definition of python variables is quite different from that of C.
C language variables:
Int I = 6
Python variable usage:
I = 4
A c-language variable must first declare the type of 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