Python PEP8: Blank lines convention

后端 未结 3 812
隐瞒了意图╮
隐瞒了意图╮ 2021-01-31 14:31

I am interested in knowing what is the Python convention for newlines between the program parts? For example, consider this:

import os

def func1():

def func2()         


        
3条回答
  •  时光取名叫无心
    2021-01-31 15:06

    Perfectly explained by user8554766

    Just a simple modification

    #Standard system imports
    import re
    import glob
    import sys
    
    #Related third party imports
    import requests
    import scrapy
    from flask import Flask
    
    #Local application/library specific imports
    from my_local_module import MyClass1, MyClass
    

    Reference

提交回复
热议问题