샘플 코드가 다른거 같아요.
안녕하세요, 수강생 여러분
학습 관련 내용을 질문해주세요!
영상에나온 Gmail Api python 샘플 코드와 현재 구글에서 제공하는 샘플 코드가 다른거같아요.
영상에서 나온 코드를 직접 타이핑 하면될까요?
참고로 구글에서 제공하는 샘플코드는 아래와 같아요.
import os.path
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError
# If modifying these scopes, delete the file token.json.
SCOPES = ["https://www.googleapis.com/auth/gmail.readonly"]
def main():
"""Shows basic usage of the Gmail API.
Lists the user's Gmail labels.
"""
creds = None
# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists("token.json"):
creds = Credentials.from_authorized_user_file("token.json", SCOPES)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
"credentials.json", SCOPES
)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open("token.json", "w") as token:
token.write(creds.to_json())
개인적으로 스크래핑/크롤링하는 사이트에 대한 질문에 대해서는 답변을 드리지 않아요!
Câu trả lời 1
1
안녕하세요 우동현님!
먼저 강의에 나온코드는 구글 샘플 코드를 참조한 코드이며, 약간 변형이 있습니다.
강의에 나온것을 사용하시면 되며, 복사를 원하시는 경우 아래 깃허브 주소에서 가져가시면 됩니다!
https://github.com/heohyunjun/Inflearn-road-to-business-automation
감사합니다, 추가 질문있으신 경우 언제든 남겨주세요!
원핫인코딩과 레이블 인코딩에서 concat
0
9
2
agent 평가 관련 문의 드립니다.
0
8
0
제2유형 질문입니다.
0
20
2
WSL에서 Airflow 실행 시 로컬 venv 라이브러리 사용 여부 및 관리 방법
0
11
2
C()
0
18
2
작업형 2에서 strafity 적용 유무
0
23
2
수강 기간 연장 가능 여부 문의드립니다.
0
18
1
ols
0
20
2
2유형 작성관련 질문(일반 심화)
0
21
2
2유형 작성관련 질문
0
19
2
2유형 object컬럼 개수 다르면
0
20
2
코딩팡질문이요ㅠㅠ
0
22
2
관찰값과 기대값의 개념이 헷갈립니다.
0
13
2
작업형2 ID 컬럼 삭제 질문
0
23
2
2유형 작성관련 질문
0
20
2
memoryerror 질문
0
18
2
작업형 유형2 이렇게 고정 템플릿으로 가져가도 될까요?
0
21
1
ID 삭제 필수 인가요?
0
19
3
띄어쓰기
0
12
1
7회 기출문제 작업형1번 df 변환 후 저장되는 방식 질문
0
16
2
매일 사용시 토큰사용량
1
20
2
3 유형 귀무가설, 대립가설
0
20
2
vs code와 github연결 방법을 모르겠어요
0
266
1
토큰 문제가 발생했어요
1
505
1

