Python notes (1)

1. Follow Liaoche Teacher's tutorial, download and install this version, download the website2. The text editor cannot be used with Word and Windows comes with Notepad. Word does not save plain text files, and Notepad will be smart to add a few

Python Processing Pictures

PIL is the most common image processing library in Python, the PIL module in Python 2.x, replaced with pillow module in Python 3.x, installing Pil:pip install Pillow1, Python view some properties of the picture#!/usr/bin/env python#-*-coding:utf-8-*-

Page---python development "first article": Directory

This blog series contains Python basics, front-end development, web frameworks, caches, and queues, hoping to provide a little help for kids who are learning to program!!! Python development "First article": Directory Python development

Python Chinese encoding

Python Chinese encodingIn the previous chapters we have learned how to output "Hello, world!" in Python, but if you output the Chinese character "Hello, the World" you may encounter Chinese coding problems.If no encoding is specified in the Python

Python's sys.argv[]

Sys.argv[] Plainly is a bridge from the outside of the program to obtain parameters, this "external" is critical. Because the arguments we get from the outside can be multiple, we get a list, which means that sys.argv can actually be seen as a list,

Python Interface Automation--requests 2

#_*_ encoding:utf-8 _*_ImportJSONImportRequests#POST RequestPayload = {"Cindy":"Hello World", "python":"1078370383"}r= Requests.post ('Http://httpbin.org/post', Data=payload)Print(R.text)#output, data data transfer to form# {#"args": {},#"

Basic knowledge of Python

First, Python2,python3 differences in the environment: Python2:1, the source code contains php,java,c, and other language norms of bad habits,2, repeat the code is particularly large. Python3: Source code is very standard, clear, simple , in line

Python's function learning

Functions and procedures are functions that have no return value, both of which can be calledin python , the function return value is The value after return, and the procedure return value is NoneProgramming: Object-oriented, process-oriented,

Python Interface Automation--requests 1

#_*_ encoding:utf-8 _*_ImportRequests#Request a blog home, no parameter GET requestR = Requests.get ('http://www.cnblogs.com/cindy-cindy/')Print(R.status_code)Print(R.text)#Search for content in the blog park, get requests with parametersPar =

Python list generation, generator

List-generated--A list can be generated quickly , and another listcan be deduced from a list , and the code is simple:>>> [x * x for x in range (1, 11)][1, 4, 9, 16, 25, 36, 49, 64, 81, 100]>>> [x * x for x in range (1, one) if x% 2 = = 0][4, 16,

Python implements proxy mode

From ABC import Abcmeta, abstractmethodnot_implemented = "Your should implement this." Class Abstractcar: __metaclass__ = Abcmeta @abstractmethod def Drive (self): raise Notimplementederror (not_implemented) class Car (Abstractcar):

Python lists and tuples

Sequence  Python has 6 total built-in sequences: Lists, tuples, strings, Unicode strings, buffer objects, and Xrange objects. #字典属于啥?The difference is that the list can be modified and tuples cannot be modified.The list can also contain other lists  

Sorting algorithm collation (Python version)

ImportRandomImport TimedefBubble_sort (a): N=Len (a) whileN>1: forIinchRange (n-1): ifA[i]>a[i+1]: Temp=A[i] A[i]=a[i+1] A[i+1]=Temp N+=-1returnadefInsert_sort (a): N=Len (a) forIinchRange (1, N): forJinchRange (i):ifA[j]>A[i]: Temp=A[i]

Seventh Day Python learning record

While----else------The role of the while behind else means that when the while loop executes normally and the middle is not terminated by a break, the statement after the else is executedCount = 0 while Count : + = 1 print("" , Count) Else :

Python-based basic linux commands, pythonlinux

Python-based basic linux commands, pythonlinux# Pwd viewing the current directory/root directory is equivalent to windows 'computer '# cd (change directory) change the directory # ls view the file ls file name under the current directory view the

Python unittest module, pythonunittest

Python unittest module, pythonunittest 1 import unittest 2 import random 3 4 5 class Operation (object): 6 7 def _ init _ (self, num1 = 0, num2 = 0 ): 8 if not (0  

93. re, Beautifulsoup, rebeautifulsoup

93. re, Beautifulsoup, rebeautifulsoup Navigate to this article: Introduction Basic usage Traverse Document Tree Search Document Tree Summary The re module is not described too much in the previous python advanced sections. This article is the

Python learning essay day3, python essay day3

Python learning essay day3, python essay day3 Document read/write   # Document content SlicingF = open ('abc', 'R', encoding = 'utf-8') # abc is the document name.Count = 0;For line in f:If count = 9:Print ("-------------------------------- cut

Python obtains some attributes of the Android apk through a script, and then generates a key using the encryption algorithm ., Androidapk

Python obtains some attributes of the Android apk through a script, and then generates a key using the encryption algorithm ., Androidapk Python obtains some attributes of the Android apk through a script, and then generates a key using the

Python timeit module, pythontimeit

Python timeit module, pythontimeit 1 import timeit 2 import math 3 4 5 def myfun (): 6 for I in range (100): 7 for j in range (2, 10): 8 math. pow (I, 1/j) 9 10 timeitObj = timeit. timer (stmt = myfun) 11 t1 = timeitObj. timeit (number = 10000) 12

Total Pages: 4013 1 .... 2782 2783 2784 2785 2786 .... 4013 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.