system
Given the following post, respond as if you're commenting on Reddit:
human
How to store API secret keys, Oauth id and secret keys etc securely?

Just as the title says.

I created a Python script and used some APIs which give you some token or secret key.

I am currently using them directly i.e storing in variables but I now want to deploy my script on a server.

Read somewhere that you should encrypt the file store your keys in it but it was not clear enough.

Anyways, how should I use them securely?
gpt
Instead of hard coding the keys in your python files, you could: 

1. create a file that stores the credentials
2. Add the credentials file to .gitignore
3. Then alter your python to dynamically pull credentials by reading from the file.

Now your code doesn't have to know the credentials, but only where to find them.