There is not a lot to look at in these 2 code blocks you have given us. Right now, I don’t know if you have imported the os modules or not. I don’t know if there is other variable values inside the .env files. I don’t know what package you are using exactly, there is a couple of dotenv packages for python out there. I don’t know if there is other part of the code that could cause this to happen.
Unless the whole python and .env files contains only what you’ve given us inside the 2 code blocks, Please give us more specifics.
Here’s an example of a repl I tried and it worked perfectly fine:
Good day @Catalactics, sorry for not specifying the package that I used and I seem to forget to paste one line from my code. I’ve updated the post and it seems that your example code and compared to mine, they’re the same. Another thing is that is it possible that the package took the value from my window’s environment? Because I named my computer’s username as User… Thank you.
Well, I solved the problem, the package indeed took the value from my window environment. So I changed the variable name to ACC_USERNAME instead of USERNAME. Anyway thanks @Catalactics