Last active
October 28, 2017 13:15
-
-
Save bazbt3/010f3989ecd6ac37cef02d9ad3bb3a20 to your computer and use it in GitHub Desktop.
Simple Python code failing with the 'secrettoken' variable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pasting the secret access token works at `pnutpy.api.add_authorization_token(secrettoken)`. HOWEVER I want to remove my access token from this code to ***allow sharing.*** | |
import pnutpy | |
import console | |
tokenfile = open("secrettoken.txt", "r") | |
secrettoken = tokenfile.read() | |
# print secrettoken | |
pnutpy.api.add_authorization_token(secrettoken) | |
# Create a post | |
posttext = raw_input("posttext: ") | |
post, meta = pnutpy.api.create_post(data={'text':posttext}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I know a little Python 3, can't figure out much of Python 2. I believe the code is valid Python 2 but it fails to work thus: