随笔分类 -  Python

摘要:类和对象1.鸭子类型:定义多个类,多个类都有相同名字的方法名,调用方法是可以同时调用官方定义: 当看到一只鸟走起来像鸭子,游泳起来像鸭子,叫起来像鸭子,那么这只鸟就可以被称之为鸭子 class Cat(object): def say(self): print("I am a cat") class 阅读全文
posted @ 2019-01-24 23:22 塔塔尔族 阅读(93) 评论(0) 推荐(0)
摘要:1.ipython工具 安装pip install ipython2.notebook 工具安装 pip install -i https://pypi.douban.com/simple notebook运行 ipython notebook 会打开浏览器在浏览器中写代码测试起来会非常方便 阅读全文
posted @ 2019-01-24 21:21 塔塔尔族 阅读(227) 评论(0) 推荐(0)
摘要:#bytes object byte = b"byte example" # str object str = "str example" # str to bytes 字符串转字节 bytes(str, encoding="utf8") # bytes to str 字节转字符串 str(byte 阅读全文
posted @ 2018-12-16 14:29 塔塔尔族 阅读(38569) 评论(0) 推荐(2)
摘要:qujfaj 阅读全文
posted @ 2018-06-23 22:00 塔塔尔族 阅读(116) 评论(0) 推荐(0)
摘要:去演 阅读全文
posted @ 2018-06-23 21:59 塔塔尔族 阅读(71) 评论(0) 推荐(0)
摘要:1基本数据类型: 字符串‘’," ",''' ''' 单引号,双引号,三引号 加法: n1='ruser' n2='sb' n3=n1+n2 print(n3) 乘法: n1='ruser' n2=n1*10 print(n2) ruserruserruserruserruserruserruser 阅读全文
posted @ 2018-06-23 21:57 塔塔尔族 阅读(108) 评论(0) 推荐(0)