Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

수입의 그룹화 #23

Open
hardware-impostors4444 opened this issue Nov 9, 2023 · 0 comments
Open

수입의 그룹화 #23

hardware-impostors4444 opened this issue Nov 9, 2023 · 0 comments

Comments

@hardware-impostors4444
Copy link

한국어가 서툰 것을 이해해 주세요
Papago와 DeepL을 사용했습니다

귀하는 다음 모듈이 공식 모듈, 제 3자 모듈, 로컬 모듈인지 구분이 가능하십니까?

import os
import sys
import foo # This module
import bar

불가능합니다 정답은
하지만 다음과 같이 작성한다면 알 수 있습니다

import os
import sys

import foo # This module

import bar

위 코드에서 foo는 제 3자 모듈 알 수 있습니다

위와 같은 상황에서 PEB8에는 다음과 같이 제안합니다
https://peps.python.org/pep-0008/#imports

Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants.
Imports should be grouped in the following order:

Standard library imports.
Related third party imports.
Local application/library specific imports.
You should put a blank line between each group of imports.

다시 문제로 넘어와서 확인합니다

# import
import time
from ETboard.lib.pin_define import *
import dht
from ETboard.lib.OLED_U8G2 import *

어떤 모듈이 표준 또는 펌웨어 빌트인 모듈인지 알 수 있습니까?
어떤 모듈이 제 3자 모듈인지 알 수 있습니까?
어떤 모듈이 로컬 모듈인지 알 수 있습니까?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant