Python常见问题处理
2014-12-28 10:33
316 查看
1:Unused import
环境:Ubuntu 14.04 eclipse 3.8
eclipse环境下利用PyDev插件做开发的时候,输入:import re,左边会出现一个黄色的警告,属标放上去后会显示:Unused import re
原因如下:(ref:http://stackoverflow.com/questions/16394732/unused-wild-import-why)
That message just tells you that you are importing features from a module that you don't need, which means you should probably import just what you need. You shuld simply use
也就是说:只import re 而没有使用 re,等后面使用到re的方法时候,这个警告自然会消除
环境:Ubuntu 14.04 eclipse 3.8
eclipse环境下利用PyDev插件做开发的时候,输入:import re,左边会出现一个黄色的警告,属标放上去后会显示:Unused import re
原因如下:(ref:http://stackoverflow.com/questions/16394732/unused-wild-import-why)
That message just tells you that you are importing features from a module that you don't need, which means you should probably import just what you need. You shuld simply use
from foobar import x, ywhere
xand
yare the elements you actually need.The syntax
from foobar import *is more useful in the command-line interpreter when you don't want to think or type many more characters for little benefit. But in a real project, you should not use that syntax since if you use it, it will not be clear which feature from the module you are going to use.
也就是说:只import re 而没有使用 re,等后面使用到re的方法时候,这个警告自然会消除
相关文章推荐
- Python安装第三方库及常见问题处理方法汇总
- Python安装常见问题处理
- Python安装常见问题处理
- python 处理Excel 常见问题-读取Excel中时间
- Python安装第三方库及常见问题处理方法汇总
- python+selenium初学者常见问题处理
- python 处理Excel 常见问题- 写入Excel
- python用法:处理sqlite中的中文字符时遇到的问题
- 使用BizTalk Server常见问题处理
- sqlite3 jdbc、c接口、python接口处理中文时遇到的问题及其解决方法
- C#进行Visio二次开发的常见问题处理
- sqlite3 jdbc、c接口、python接口处理中文时遇到的问题及其解决方法
- 电脑常见问题处理(二)
- 使用BizTalk Server常见问题处理
- MFC常见问题的处理方式
- CSS常见技巧及问题处理
- [转]python中文字符串处理问题
- [转载]LINUX 常见问题处理
- Vista六个常见问题的处理
- 电脑常见问题处理(四)