python
ziyou飞翔
嵌入式linux爱好者+从业者
展开
-
解决Python.h: No such file or directory
编译安装 -4.1.1时出现如下错误 :pgmodule.c:31:20: error: Python.h: No such file or directory解决方法:apt-get install python-dev然后再执行:python setup.py build sudo python setup.py install原创 2015-10-19 13:51:16 · 4377 阅读 · 0 评论 -
Python logging模块详解
一、简单将日志打印到屏幕:[python] view plaincopyimport logging logging.debug('debug message') logging.info('info message') logging.warning('warning message') logging.error('err转载 2015-10-21 15:16:25 · 462 阅读 · 0 评论 -
python数字、字符串对齐
#!/usr/bin/pythondata1=5data2=10str1 ='iot_history_%-2d'%data1 + ' ok'str2 ='iot_history_%-2d'%data2 + ' ok'print str1print str2输出:iot_history_5 okiot_history_10 ok转载 2015-10-21 15:31:31 · 6749 阅读 · 0 评论 -
Python中加入中文注释
最近开发学习Pyton,当加入中文注释时,运行程序报错: File “./test1.py”, line 3 SyntaxError: Non-ASCII character ‘\xe6’ in file ./test1.py on line 3, but no encoding declared; see http://www.python.org/peps/pep-0263.html fo原创 2017-04-23 19:08:04 · 4923 阅读 · 0 评论