摘要:
首先要pip install pymysqlimport pymysql,sys#print(sys.path)from settings import mysql_info# sql='insert into user (username,password) VALUE ("haha","man" 阅读全文
摘要:
#正则表达式就是来查找字符串的,它能查找规则比较复杂的字符串 # (.*):贪婪模式,匹配尽可能多的字符 # (.*?)或(.+?):匹配尽可能少的字符,一旦匹配到第一个就不往下走了。 import re s = 'besttest is good' print(re.match(r'be',s). 阅读全文
摘要:
#函数的作用域是就近原则def warpper(): name = 'cici' print('i am out of box %s'%name) def deco(): name = 'lily' print('i am in box %s'%name) def hhh(): print('xxx 阅读全文
摘要:
#1\判断小数#1.92#-1.988def is_float(s): ''' 这个函数是用来判断传入的是否为小数,包括正小数和负小数三 :param s :传入一个字符串 :return: True or False ''' s = str(s) if s.isdigit(): return Fa 阅读全文