SlackにPython3でMessageをPostするコードを書いたので備忘録です。 Slackにエラーログを送ったり、アラート通知などに活用する。 開発環境 Mac10.14.1 Python3.7.0 Slack: WebHookURLが必要 SlackにPostするときにAPI仕様を確認する ( Attachment structure ) https://api.slack.com/docs/message-attachments import urllib.request import json url = 'https://hooks.slack.com/services/xxxxxxxxxxxxxxxxxxxxx' def post_slack(msg): set_fileds = [{ "title": "TITLE", "value": msg, "short": Fa