摘要: class Zll(object): def __init__(self): self.money=100000000 self.house='3环里20套' def sing(self): print('唱歌') def dance(self): print('跳广场舞') def lm(self 阅读全文
posted @ 2018-05-25 18:26 彼得潘jd 阅读(78) 评论(0) 推荐(0) 编辑
摘要: import redisclass My(object): try: def __init__(self): self.__host='xxx.xxx.xxx.xxx' self.__port=6379 self.__password='123456' self.r=redis.Redis(host 阅读全文
posted @ 2018-05-25 18:24 彼得潘jd 阅读(101) 评论(0) 推荐(0) 编辑
摘要: import pymysqlclass MyDb(object): #新式类 def __del__(self):#析构函数 self.cur.close() self.coon.close() print('over...') def __init__(self, #构造函数 host,user, 阅读全文
posted @ 2018-05-25 18:22 彼得潘jd 阅读(105) 评论(0) 推荐(0) 编辑
摘要: class Baby(): country='China' #类变量,公共的变量 def __init__(self,name): print('self的内存地址',id(self)) self.name=name # self代表的就是实例化之后的对象 self.money=5000 self. 阅读全文
posted @ 2018-05-25 18:21 彼得潘jd 阅读(149) 评论(0) 推荐(0) 编辑
摘要: from urllib import parseurl='http://www.baidu.com?qurey=python基础教程 @@@'# url_str=parse.quote_plus(url) #url编码print(parse.quote_plus(url))from urllib i 阅读全文
posted @ 2018-05-25 18:19 彼得潘jd 阅读(450) 评论(0) 推荐(0) 编辑
摘要: class Person: #类名首字母大写 #经典类 def __init__(self): #构造函数 self.nose=1 #鼻子 #属性 self.face= 1 #脸 self.head= 1 #脑子 self.wing = 4 #翅膀 def driver(self): print(' 阅读全文
posted @ 2018-05-25 18:14 彼得潘jd 阅读(149) 评论(0) 推荐(0) 编辑
摘要: import yagmailusername='XXXXXXXXXX@qq.com' #邮箱passwd='XXXXXXXXX' #授权码mail=yagmail.SMTP(user=username, password=passwd, host='smtp.qq.com', #如果是163邮箱写成 阅读全文
posted @ 2018-05-25 18:11 彼得潘jd 阅读(95) 评论(0) 推荐(0) 编辑