cevincheung
V2EX  ›  问与答

像这种问题怎么破 module level import not at top of file 关于 PEP8

  •  
  •   cevincheung · Sep 19, 2017 · 3033 views
    This topic created in 3183 days ago, the information mentioned may be changed or developed.
    # config:utf-8
    
    from flask import Blueprint
    
    main_app = Blueprint('main', __name__, template_folder='../views/')
    
    
    from . import views, errors <- 这行
    

    Flask 应用 放到顶层在 views 和 errors 就报 can not import 'main'错误。放到底下吧,就不 PEP 了……

    1 replies    2017-09-22 14:55:59 +08:00
    cevincheung
        1
    cevincheung  
    OP
       Sep 22, 2017
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2963 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 14:43 · PVG 22:43 · LAX 07:43 · JFK 10:43
    ♥ Do have faith in what you're doing.