Ask coding questions

← Back to all posts
How do I add info from the secrets folder to my code?
belk42 (0)

I made the key --> TOKEN but when I try to add it in using the code
client.run(os.getenv('TOKEN')
I just get an error. This is the error:
" File "main.py", line 19
SyntaxError: unexpected EOF while parsing"
There is nothing at line 19

Comments
hotnewtop
Saml2020 (58)

In Python for every ( you will need a )

So to fix your issue change it to

client.run(os.getenv('TOKEN'))
belk42 (0)

@Saml2020 unfortunately i still cant get it to work

Saml2020 (58)

@belk42 my_secret = os.environ['TOKEN'] This shows that my_secret already contains the token.

So the last line should be client.run(my_secret)