摘要: python使用命名空间记录变量。python中的命名空间就像是一个dict,key是变量的名字,value是变量的值。 python中,每个函数都有一个自己的命名空间,叫做local namespace,它记录了函数的变量。 python中,每个module有一个自己的命名空间,叫做global 阅读全文
posted @ 2018-03-07 13:11 learndu 阅读(180) 评论(0) 推荐(0) 编辑
摘要: [Wed Jan 31 19:01:18.044138 2018] [wsgi:error] [pid 10144:tid 804] [client ::1:54225] mod_wsgi (pid=10144, process='', application='localhost|'): Fail 阅读全文
posted @ 2018-01-31 19:07 learndu 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 配置python+mod_wsgi+apache 时 在浏览器中访问服务器时报错:Invalid HTTP_HOST header: 'XXXXX'. You may need to add u'XXXXX' to ALLOWED_HOSTS,在setting.py中添加ALLOWED_HOSTS[ 阅读全文
posted @ 2018-01-31 17:13 learndu 阅读(494) 评论(0) 推荐(0) 编辑
摘要: 问题的关键 就是在给confirm显示之前,将数组转换成字符串,并以每个数组的元素为一个字符串,加上一个换行回车符即可: 代码中的背景色 为关键的点 <script type="text/javascript"> $(function () { //获取已选的复选框的值 var checkedArr 阅读全文
posted @ 2018-01-11 19:53 learndu 阅读(264) 评论(0) 推荐(0) 编辑
摘要: dBm = 10 + 20lg(0.5Vpp) Vpp = 2x10 以上公式均为正弦波,阻抗为50欧的情况下计算得出的 阅读全文
posted @ 2017-11-29 15:07 learndu 阅读(5469) 评论(0) 推荐(0) 编辑
摘要: 在python控制台输入import this之后输出如下: The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than co 阅读全文
posted @ 2017-11-29 14:31 learndu 阅读(397) 评论(0) 推荐(0) 编辑
摘要: def logger(func): def inner(*args, **kwargs): #1 print "Arguments were: %s, %s" % (args, kwargs) return func(*args, **kwargs) #2 return inner >>> @log 阅读全文
posted @ 2017-11-22 13:09 learndu 阅读(163) 评论(0) 推荐(0) 编辑
摘要: #定义函数 def Get_Counter_AllMeasureValue(self, inst_dg_address): """ get all measure value ,as Frequency,period,duty,+width,-width,and so on... :param in 阅读全文
posted @ 2017-11-20 17:09 learndu 阅读(5143) 评论(0) 推荐(0) 编辑