Ask coding questions

← Back to all posts
How do you encrypt ENV files in python?
h
okalisl

Is there any way to write to a file and have it encrypted in an env file?

Answered by VulcanWM [earned 5 cycles]
View Answer
Voters
okalisl
Comments
hotnewtop
VulcanWM

You have to manually add values to the env files if that’s what you mean

okalisl

Thanks @VulcanWM, but can I write it to the file in the python code or just manually append it?

VulcanWM

there is no way you can change the env variables in Python @okalisl

okalisl

Ok thanks for your [email protected]!

VulcanWM
Saml2020

I guess you can save it in an enviromental variable, then run it with exec()