#đź”’ .env file help

25 messages · Page 1 of 1 (latest)

timber timber
#

I have tried looking up how to create a .env file but have found no help for newer python coders like myself. I am in the process of trying to learn how to code a discord bot. I just need a detailed explanation of how to create a .env file if anyone is help to help with that.

hexed hareBOT
#

@timber timber

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dreamy quartz
#

The file itself is just text. Open a new file, write what you need, save it.

timber timber
#

So just in IDLE?

vivid rain
timber timber
#

Ok thank you

timber timber
#

I’m still very new to all of this so it’s hard to figure anything out

vast plover
#

what do you plan to store in your env file

timber timber
#

My discord bot’s token

vast plover
#

what have you got so far

timber timber
#

I don’t have much

#

Cause I just started it today

#

But I have the few thing I needed installed like dotenv and discord.py

#

I have the .env file setup

vast plover
#

this lib?

timber timber
#

Yes

vast plover
#

so you have a .env file, you just need to read from it?

timber timber
#

Basically yeah

vast plover
#

the code references in those docs seems pretty straightforward, what issue are you running into?

timber timber
#

It’s more because the code I have is just not working when I try to run it

#

I have to run “python bot.py” and when I do that I get a error that says the file or directory doesn’t exist idk if I just don’t have the files in the right spot or not

hexed hareBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.