How to Create Environment Variables on Windows - Easy!

  Рет қаралды 43

Ferds Tech Channel

Ferds Tech Channel

Күн бұрын

#python #pythonforbeginners #vscode
How to Create or Modify Environment Variables in Windows
1. setx MY_VAR "Hello World"
2. echo %MY_VAR% - displays the value of the variable. Close and reopen the command prompt.
3. set - displays all variables.
4. setx MY_VAR “” unset a variable.
5. set TEMP_VAR=Temp_Value - variables will not persist after the command prompt is closed.
Below is the code I used in the video:
import requests
import os
#set url=official-joke-...
Get the 'url' environment variable
url = os.getenv('url')
Make the GET request if 'url' is set
if url:
response = requests.get(url)
joke = response.json()
print(f"Joke: {joke['setup']}")
print(f"Punchline: {joke['punchline']}")
else:
print("Environment variable 'url' is not set.")

Пікірлер
How to convert .pyc to .py on Windows (Step by Step)
4:17
Ferds Tech Channel
Рет қаралды 349
VSCode Features Python Devs NEED To Know
9:54
Tech With Tim
Рет қаралды 17 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 75 МЛН
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 29 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 111 МЛН
Load Environment Variables From .env Files in Python
10:18
NeuralNine
Рет қаралды 72 М.
Learn Any Programming Language In 3 Hours!
22:37
Code With Huw
Рет қаралды 440 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 554 М.
How are holograms possible?
46:24
3Blue1Brown
Рет қаралды 569 М.
How to connect to WSL in VS Code - Easy!
6:50
Ferds Tech Channel
Рет қаралды 332
5 Hidden React Server Function TRAPS Beginners Fall Into
21:31
Jack Herrington
Рет қаралды 6 М.
DHH discusses SQLite (and Stoicism)
54:00
Aaron Francis
Рет қаралды 84 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 75 МЛН