最近我开始学习Python并在我的Python文件上运行了Pylint。我得到了以下的评论。
from os import listdir
from os.path import isfile, join
在上面两行中,Pylinter的注释是
C: 5, 0: Imports from package os are not grouped (ungrouped-imports)
我该如何实现这个目标?
还有一条评论在下面一行
import mimetypes, time, csv, platform, base64, django, sys, os, math, uuid, linecache, logging, requests
C: 5, 0: standard import "import mimetypes, time, csv, platform, base64, django, sys, os, math, uuid, linecache, logging, requests" should be placed before "import mimetypes, time, csv, platform, base64, django, sys, os, math, uuid, linecache, logging, requests" (wrong-import-order)
上面这行代码是什么意思,为什么需要它?
import mimetypes, time, csv, platform, base64, django, sys, os, math, uuid, linecache, logging, requests
或者说它不是错误的,但从风格上讲不够优秀。 - mklucz