I am trying to work on a bot using Twitter API, in order to hide my credentials I decided to put the four of them in environmental variables and use os
module with the method os.getenv()
to get them in my code.
The problem is that the method is always returning None
, even though the variable does exists. Do i need to give the program admin privileges to get these variables, or the problem is in other place?
In case it is needed, I am using Windows 7 as OS.
import os
consumer_key = os.getenv("CONSUMER_KEY")
consumer_secret = os.getenv("CONSUMER_SECRET")
access_token = os.getenv("ACCESS_TOKEN")
access_token_secret = os.getenv("ACCESS_TOKEN_SECRET")