diff --git a/basics/basics.md b/basics/basics.md index 1c6555b..ed1cdb4 100644 --- a/basics/basics.md +++ b/basics/basics.md @@ -6,4 +6,28 @@ Check if execution is in main program ````python if __name__ == '__main__': -```` \ No newline at end of file +```` + +## Load modules +````python +import +```` + +````python +from import +```` + +## Install requirements +Create a file called `requirements.txt` in the root of the directory and add the required python modules +````text +# requirements.txt +python-dotenv +discord-webhook==1.3.0 +```` + +Optionally you can ad == to specify the required version of the module + +Install the modules with the following command: +````bash +pip install --no-cache-dir -r requirements.txt +```` diff --git a/basics/enviromment.py b/basics/enviromment.py new file mode 100644 index 0000000..d7da098 --- /dev/null +++ b/basics/enviromment.py @@ -0,0 +1,11 @@ +# Envirommental variables +# Michi von Ah - October 2023 + +# Import required modules +import os +from dotenv import load_dotenv + +# Load variables from .env file +load_dotenv() + +os.getenv('TEST') # Example output: Hello World! \ No newline at end of file