摘要:32-Python3 MySQL(mysql-connector) 阅读全文
25-Python3 错误和异常
2018-11-20 13:26 by 改改~_~, 146 阅读, 0 推荐, 收藏, 编辑
摘要:25-Python3 错误和异常 ''' 语法错误 ''' # while True print('hello,runoob') ''' 异常 ''' ##ZeroDivisionError # print(10*(1/0)) ##NameError # print(4+spam*3) ##Type 阅读全文
23-Python3 File
2018-11-20 11:45 by 改改~_~, 215 阅读, 0 推荐, 收藏, 编辑
摘要:''' file(文件)方法 ''' #open()对象 pass #file对象 ##file.close():关闭文件,关闭后不能再进行读写操作 fo1 = open('/Users/ligaijiang/PycharmProjects/fo1.txt','wb') print('文件名为:',fo1.name) fo1.close() ##file.flush() fo2 = ope... 阅读全文
22-Python3 输入和输出
2018-11-20 11:44 by 改改~_~, 253 阅读, 0 推荐, 收藏, 编辑
摘要:''' 输出格式美化 ''' s = 'Hello,Runoob' #repr():将输出读值转化成字符串,产生一个解释器易读读字符 print('repr():',repr(s)) #str():将输出读值转化成字符串,返回一个用户易读的表达式 print('str:',str(s)) # print(str(1/7)) # x = 10*3.25 y = 200*200 s1 = '... 阅读全文