일단 LINE에 알림을 원하기 때문에 적절한 스크립트를 만들었습니다.
4251 단어 파이썬LineNotify
동기
그래서 학습이 끝나면 어떠한 형태로 통지를 갖고 싶다고 생각했습니다.
그래서, LINE에 통지가 오면 뭐 어디에 있어도 수신할 수 있을 것 같기 때문에,
쉽게 LINE에서 알림이 오는 스크립트를 Python으로 만들었습니다.
코드
LINE Notify 페이지 내 페이지에서 액세스 토큰이 발행되었습니다
일단 만들어 졌기 때문에 매우 적합합니다
Python2.7 환경에서 작동 확인했습니다.
line_notification.py
import subprocess
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(
prog='line_notification.py',
usage='Exec on terminal.',
add_help=True,
)
parser.add_argument('-t', '--token', help='LINE ACCESS TOKEN', required=True, type=str)
parser.add_argument('-m', '--message', help='message data', required=True, type=str)
args = parser.parse_args()
# LINE notification
command = 'curl -X POST -H \'Authorization: Bearer {TOKEN}\' -F \"message={MESSAGE}\" https://notify-api.line.me/api/notify'.format(
TOKEN=args.token,
MESSAGE=args.message
)
subprocess.call(command, shell=True)
사용법
python line_notification.py -t "ACCESS_TOKEN" -m "MESSAGE"
Reference
이 문제에 관하여(일단 LINE에 알림을 원하기 때문에 적절한 스크립트를 만들었습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/mag-chang/items/39ccaee638a32b0fa561
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
python line_notification.py -t "ACCESS_TOKEN" -m "MESSAGE"
Reference
이 문제에 관하여(일단 LINE에 알림을 원하기 때문에 적절한 스크립트를 만들었습니다.), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/mag-chang/items/39ccaee638a32b0fa561텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)