title: How to have Python post a file to Slack
body: <p>I have a Python script that currently posts a link to a slack group chat. What can I change or add to make it drop a CSV file instead of dropping the link to take you to the CSV file. Thank you</p>
  
  <pre><code>def post_slack():
      """Post slack message."""
      try:
          token = 'token'
          slack = Slacker(token)
  
          obj = slack.chat.post_message(
              channel='#dataworksapp',
              text='https://console.cloud.google.com/storage/browser/firebase_results/?project=dataworks-356fa',
              as_user=True,
              attachments=[{"pretext": "Subject",
                            "text": "Body"}])
          print obj.successful, obj.__dict__['body']['channel'], obj.__dict__[
              'body']['ts']
      except KeyError, ex:
          print 'Environment variable %s not set.' % str(ex)
  
  
  if __name__ == '__main__':
      post_slack()
  
  #post to slack above
  </code></pre>