![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
songbaiyiran
这个作者很懒,什么都没留下…
展开
-
python getattr/setattr/hasattr的用法
python getattr()/setattr()/hasattr()自省函数原创 2017-09-01 17:48:24 · 328 阅读 · 0 评论 -
ajax异步请求,生成表格,局部刷新
先来一段简单的html表单:<form onsubmit="return false" id="formAddtr" method="post"> <input type="text" name="id"> <button id="select1" onclick="subForm()">查询</button></form>注意要写上onsubmit=”return false”,原创 2017-10-20 17:16:43 · 20737 阅读 · 5 评论 -
python干货分享/网址总结
一位程序员总结的《流畅的python》所有知识点:https://www.toutiao.com/a6476383114909188621/?tt_from=mobile_qq&utm_campaign=client_share&app=news_article&utm_source=mobile_qq&iid=16017938436&utm_medium=toutiao_ios转载 2017-10-14 12:50:09 · 449 阅读 · 0 评论 -
python:mysql中in参数化
第一种:拼接字符串,可以解决问题,但是为了避免sql注入,不建议这样写还是看看第二种:使用.format()函数,很多时候我都是使用这个函数来对sql参数化的举个例子:select * from XX where id in (1,2,3)参数化in里面的值:select * from XX where id in ({}).format('1,2,3')你可以打印下看原创 2017-10-24 12:59:38 · 5066 阅读 · 0 评论 -
django数据库本地配置/python读取本地配置文件
首先创建一个本地文件config.ini,是.ini格式的配置文件,值不用加引号,读取过去就是字符串格式文件内容:[global]ip = xxxport = xxxtable = xxxuname = xxxpasswd = xxx读取本地配置文件用了个django自带的模块:configparser在settings.py 中设置如下,按照相对路径取原创 2017-10-14 12:04:40 · 5396 阅读 · 0 评论 -
python与mysql交互/读取本地配置文件/交互报错
python与mysql交互/读取本地配置文件/交互报错[Errno 11004] getaddrinfo faileddjango操作mysql时django.db.utils.OperationalError: (2003, "Can't connect to MySQL server")错误can only concatenate tuple (not "bytes") to tuple原创 2017-10-16 16:52:39 · 1797 阅读 · 0 评论