Product_list = [("Iphone", 6000),("Mac Pro", 12800),("Bike", 600),("Watch", 8000),("book", 24),("Offee", 35),]Shopping_list = ()Salary = (Input ("Please enter your purchase:"))If Salary.isdigit (): # To determine if the value entered is numeric,
1 #Goal: Title, Introduction, author, word Count2 #first determine the list of source code3 Importurllib.request4 ImportRe5 fromBs4ImportBeautifulSoup6 ImportRandom7 Import Time8 9Load=input ("Path:")TenNum=input ("Enter the number of pages:") One
One, Time module: Import time1, Time.sleep (3) #单位为妙Second, Urllib1. Pass a URL address to get its HTML content: from Urllib.request import UrlopenFrom urllib.request Import urlopenres = Urlopen (' http://crm.oldboyedu.com '). Read ()
Python variable nameThe variables in Python are named, broadly similar to other languages, with the following naming conventions:
Variable names are any combination of numbers, letters, and underscores
The first character of a variable
Environment: Ubuntu16.04 Anaconda Python2.7 opencv2.4.13Import CV2 encountered an error message after installing OPENCV:No module named Cv2When you install OPENCV, the file "Cv2.so" appears during make, which is the key file that connects OpenCV and
A loop statement:1.1 for X in Rang (n): #rang (n) generates a sequence of left closed right open intervals1.2 While x condition N:Two conditional statements:An IF condition expression:Elif expression:Elif expression:...ElseThree Break ContinuFour:
Uh, today to look at encryption and decryption, this article discusses the Base64 and Hashlib libraries:Look at Hashlib, he is a one-way summary of the method of setting the length string:The code of the masturbate: In []: import Time,hashlibin [
Function-oriented programming and object-oriented programming comparisonVim day7-2.py#!/usr/bin/python#-*-coding:utf-8-*-def Bar (): print ' Bar def Hello (name): print ' I am%s '%nameclass foo:
def Bar (self): print ' bar '
Input, outputHow does python receive user input, use the input function, use Raw_input in Python2, receive a string, output, the first program has been written using print, code into the following:
12
Name=input (' Please enter
VariableUsed to store things#定义变量Name=' Feifei '#定义变量, stringAge=18.9#整型或者小数定义变量不需要加引号Print (name)Print (age)Name2= "What ' s your name"#里面有单引号外面就用双引号Name3= ' You look very handsome'#里面是双引号外面就用单引号Name4=""you look very handsome
When writing an automation script to locate the browser element, the following error is reported:Code:# Coding=utf-8 from Import webdriver>>> driver = webdriver. Ie ()>>> driver.get ("www.baidu.com")>>> driver.find_ element_by_id ("kw"). Send_keys (
These two days in the Python bottle Framework for the development of a background management system, the interface convention using RESTful style requests, the front end uses jquery Ajax to interact with the interface, the use of post and get
Definition of a method of a class
1.def fun_name (self,...);
Pass
2. The parameter self represents an instance of the class that is automatically supplied by the system when the method is called
3. The method definition must indicate the self
Day 3 network basics, day Network BasicsNetwork basics 1. What are Internet protocols and why are there internet protocols required?
Internet Protocol: Refers to a series of unified standards, which are called Internet protocols. The essence of
Use Python to operate the instance code on the Csv file,
Csv is the abbreviation of Comma-Separated Values. It is the table data stored in the form of text files, such as the following table:
It can be stored as a csv file with the following
Python entry _ condition control (detailed description) and python explanation
The condition control is actually the use of if... else... (if the conditions are true, do...; otherwise, do ...).The basic structure is:
For more information, see the
Use the python library itchat to implement the automatic reply function, pythonitchat
Preface
On the forum, you can see Python login and automatic sign-in to learn about a new Python Library: itchat.
Using the Python library itchat, You can
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