How to Use Python Environment Variables

preview_player
Показать описание
In this data science quick tip video, I will show you how to keep secrets and configurations out of version control with python environment variables. We will store these variables in a special file, and then, we use the python dotenv package to load the environment variables in our script.

🕑 Timestamps
00:00 Introduction
00:23 Store environment variables
01:19 Load environment variables
03:20 Update gitignore file

💡 VS Code Tips for Data Science
Рекомендации по теме
Комментарии
Автор

It's so great, I am a beginner with python. I currently have this question, then I find this video, this video completely solves my problem, thank you so much.

沅晉李
Автор

I use the keyring library for this purpose, you setup passwords for different services once and then retrieve them as necessary. In windows it stores the passwords in the windows credentials manager.

alaverdyan
Автор

Does this need to be done for each script file that has environment variables, or is there a way to condense the importing all into one file? I'm new to Python

SimonBitan
Автор

thanks brother but if i put my work(project ) on any website i will also feed the env file huh?and it will be safe or not?

aeali-vp
Автор

The VSCode documentation seems to indicate that it will automatically find your .env file if it's in your workspace folder, but it's not working for me. Have you tried that?

drewfasa
Автор

Also, can you pls zoom in for later vids? Hard to read your code 🙂

drewfasa
Автор

my two problems are:

1. not all of the commands that run straightforward with you, run with me the same.
2. the side sound you make when you speak makes me nervous.

kawtherhamad
Автор

The quality of your videos are insane! Good job dude!

smart
Автор

I simply can not make this work on 3.12 - do you reckon do use 3.8 or 3.9 in general?

geetv
Автор

I love how clear and concise your video is. I just finished reading 2 articles on this subject and was a still a bit foggy on the exact process. Great job. Keep the videos coming.

jpurs
Автор

Thanks alot. I'm surely saving this video for future use

rd_Son
Автор

THANK YOU I REALLY APPRECIATE . IT'S BENEFICIAL

hassanmohajer
Автор

hey man great video this is exactly what i was trying to figure out! just one question.

i see you were using a .gitignore template, i was curious if they was a way to automatically create one of those everytime i make a new project or clone a github repo. this way i wont accidentally forget to make one :D do you know if that is possible?

rushhour
Автор

This deserves way more views, really nice quality. Thanks!

CatJell