Importing Env the OLD WAY
Normally, you would import a
.env file in python something like this...
token = "wibfwuiofnweongmarhk4" secret = "7289r;3'4h39'ae"
However, Replit has recently disabled the adding of
.env files and requires the key, values to be entered manually or in json format.
This is not good if you have an env file 50 lines long.
I found out a way around this and wanted to share it with you all.
- First, create a file with a
- Add the key values like you normally do (aka the old method using "=")
- Go to the Shell and type the following commands
a = open("filename.txt").read()
f = open(".env","w)
You can see your keys in the Secrets tab now and you can delete that .txt file