随笔分类 -  Python基础

摘要:代码如下: 这叫协程,又叫微线程。 运行结果如下: 阅读全文
posted @ 2017-08-13 14:52 人生入戏 阅读(265) 评论(0) 推荐(0)
摘要:#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = '人生入戏' user = "admin" passwd = "123456" def auth(auth_type): #print("auth_type:",auth_type) def out_wrapper(func): #print("... 阅读全文
posted @ 2017-08-12 22:26 人生入戏 阅读(196) 评论(0) 推荐(0)
摘要:运行结果如下: 阅读全文
posted @ 2017-08-11 15:12 人生入戏 阅读(294) 评论(0) 推荐(0)
摘要:列表注意细节: 1.list.clear():将列表中成员清空(与del list区别开) 2.list.copy():复制一份相同的列表(浅COPY,只复制列表第一层) 3.如果两个列表相等,如list1 = list2,list1发生改变,list2也会发生改变,不受程序执行的顺序的影响。区别于 阅读全文
posted @ 2017-08-09 18:39 人生入戏 阅读(233) 评论(0) 推荐(0)