python day ten

一、小知识点

1、在python里边没有块级作用域。

2、python中以函数作为作用域。

3、python中有作用域链,由内向外找,直到找不到报错。

4、对于python作用域来说,在函数未执行之前,作用域和作用域链已经确定好了。

二、python2.7多继承和python3.0多继承

三、socketserver源码

并发处理socket

1、IO多路复用

2、多线程

时间: 2024-08-06 07:39:52

python day ten的相关文章

Python数据功能转义以及运算符总结-ten day

一.赋值运算符 赋值运算把a的值,经过运算,把运算结果赋值给b. 二.比较运算符 比较运算的结果返回的值是bool值,为True和False,一般用来控制程序执行的流程,比如说下面的代码: 1 if a == b: 2 3 执行print(......) 4 5 else: 6 7 执行print(----) 三.逻辑运算 逻辑运算返回结果为布尔值,控制程序计算:x and c :and为真时后面都为真; a and b or c :and为假时计算or是否为真,为真继续运算,为假为False;

python: the difference between append and extend

Data Analysis: indoor localization using received signal strength (RSS) An error about list operation in python: append and extend elements We define a list A to storage objects, which the length is unknown, and list B and C to storage the final resu

Python语言100例

Python版本:python 3.2.2 电脑系统:win7旗舰 实例来源:python菜鸟教程100例 1 #!/usr/bin/python 2 # -*- coding: UTF-8 -*- 3 import string 4 import math 5 import time 6 import sys 7 import os 8 #import pygame 9 #eg1:There are 1, 2, 3, 4 numbers, can be composed of a number

第三节课: Python 基本数据类型讲解(2/3)

字符串认知与应用 认知1: 字符串的概念 认知2: acii unicode utf8到底是啥 Python默认的文件编码是ascii 1. len 之注意事项 ( decode()需要测试 ) >>> len("分析") 4 >>> len(u"分析") 2 2. 转义字符串 print('adb\') print('adbd\n') 3. 字符串跟着的小尾巴 a = u"哈哈哈" -- 表示是unicode

Coursera课程《Python数据结构》中课程目录

Python Data Structures Python Data Structures is the second course in the specialization Python for Everybody. It covers Chapters 6-10 of the textbook Python for Informatics, which is the same material as the second half of the course Programming for

Coursera课程《Python数据结构》中课件

You can access the Google Drive containing all of the current and in-progress lecture slides for this course through the link below. Lecture Slides You may find it helpful to either bookmark this page or download the slides for easy reference. Here a

Python重写C语言程序100例--Part5

''' 程序31] 题目:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续 判断第二个字母. 1.程序分析:用情况语句比较好,如果第一个字母一样,则判断用情况语句或if语句判断第二个字母. 2.程序源代码: ''' from sys import stdin letter = stdin.read(1) stdin.flush() while letter != 'Y': if letter == 'S': print 'please input second letter

Python Celery队列

Celery队列简介: Celery 是一个 基于python开发的分布式异步消息任务队列,通过它可以轻松的实现任务的异步处理, 如果你的业务场景中需要用到异步任务,就可以考虑使用celery. 使用场景: 1.你想对100台机器执行一条批量命令,可能会花很长时间 ,但你不想让你的程序等着结果返回,而是给你返回 一个任务ID,你过一段时间只需要拿着这个任务id就可以拿到任务执行结果, 在任务执行ing进行时,你可以继续做其它的事情. 2.你想做一个定时任务,比如每天检测一下你们所有客户的资料,如

PYTHON学习---第一部分

第一个程序 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # Author:xll 4 print("Hello World!") 在linux上需要用#!/usr/bin/env python告诉系统用什么解释器来执行此段代码 # -*- coding: utf-8 -*-则是指示此段代码的编码格式,一般作为固定格式 变量 1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3