-
<PYTHON> Slack webhookFlower in my dev/Python 2021. 2. 15. 09:10
1. python 내부함수사용
import json import requests URL = "Slack webhook url" TEXT = "Message" HEADER = {'Content-Type':'application/json'} payload= {"text": TEXT} requests.post( URL, data=json.dumps(payload), headers=HEADER )
2. slack-webhook 사용
pypi.org/project/slack-webhook/
slack-webhook
slack-webhook is a python client library for slack api Incoming Webhooks on Python 3.6 and above.
pypi.org
$ pip install slack-webhook from slack_webhook import Slack URL = "Slack webhook url" TEXT = "Message" slack = Slack(url=URL) slack.post(text=TEXT)
'Flower in my dev > Python' 카테고리의 다른 글
<PYTHON> requests (1) 2021.02.15 <PYTHON3> jupyter notebook 설치 (0) 2021.01.19 <PYTHON>[Numpy_07 집합&파일입출력] (0) 2017.11.29 <PYTHON>[Numpy_06 불리언&정렬] (0) 2017.11.29 <PYTHON>[Numpy_05 배열연산&산술&통계] (0) 2017.11.27