TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #303 · 27 дек.

Наверняка вы замечали, что в Python есть удобная функция для получения переменной окружения os.getenv(NAME) И её "сестра" для создания или изменения переменных окружения os.putenv(NAME, VALUE) Но почему-то putenv() не работает как должно. Энвайромент не обновляется! os.putenv('MYVAR', '1') print(os.getenv('MYVAR')) ... и ничего 😴 Почему так? На самом деле энвайромент обновляется, но это значение не добавляется в словарь os.environ. Откройте исходник функции os.getenv(). Это просто шорткат для os.environ.get() В то время как putenv() это built-in С-функция. Словарь os.environ (или точней класс из MutableMapping) создаётся из энвайромента в момент инициализации. Функция putenv() самостоятельно его не изменяет. В тоже время, когда вы создаёте или изменяете ключ в os.environ, автоматически вызывается putenv() в методе __setitem__(). То есть, технически putenv() всё делает верно, но в os.environ это не отражается. Можно проверить так: >>> os.putenv('MYVAR', '123') >>> os.system('python -c "import os;print(os.getenv(\'MYVAR\'))"') 123 Я объявил переменную в текущем процессе и вызвал дочерний процесс, который её унаследовал и получил в составе os.environ. Аналогично при удалении переменной вызывается еще одна built-in функция unsetenv(), удаляющая переменную из системы. Итого ▫️ Удобней всего явно обновлять переменные через os.environ ▫️ Есть способ неявно создать/удалить переменную через putenv/unsetenv, что не повлияет на os.environ но изменит энвайромент и передаст изменения сабпроцессам. Но так лучше не делать! ▫️os.environ это просто обертка для built-in функций putenv() и unsetenv(). #basic

Hashtags

Резултати

Пронајдени 5 слични објави

Пребарај: #learntocode

当前筛选 #learntocode清除筛选
Dasturlash hayoti️️ ️

@dasturlash_hayoti · Post #3990 · 05.10.2025 г., 06:58

#DasturlashHayoti#LearnToCode#Programmer Har bir dasturchi bilishi kerak bo‘lgan 5 ta bepul manba 🆓Pul to‘lamasdan bilim olishning eng zo‘r manbalari: 1️⃣FreeCodeCamp — front-end’dan tortib back-end’gacha 2️⃣roadmap.sh — qaysi yo‘nalishdan boshlashni aniq ko‘rsatadi 3️⃣Frontend Mentor — haqiqiy dizayn asosida kod yozish mashqi 4️⃣CSS Battle — o‘yin orqali CSS o‘rganasiz 5️⃣DevDocs — barcha texnologiyalar hujjatlari bitta joyda Bilim — eng yaxshi investitsiya. Ayniqsa, pulsiz bo‘lsa yanada yoqimli 😄 Shunaqa postlar davom etsin desangiz, ulashib qo‘ying — birga o‘rganamiz! 💪 💻@dasturlash_hayoti— Dasturchilar uchun eng kerakli maslahatlar va foydali kontent

Repositorio data science

@repo_science · Post #4259 · 08.12.2025 г., 03:46

#SpringBoot#RESTAPI#BackendDevelopment#CodeWithMosh#Java#StripeIntegration#CloudDeployment#LearnToCode 🚀 Ready to take your backend skills to the next level? 🔗Spring Boot: Mastering REST API Development🎓 - Learn to build clean, secure RESTful APIs - Add authentication, role-based access, and JWT security 🔒 - Integrate Stripe for real payment processing 💳 - Deploy your app and database to the cloud ☁️ - Apply industry best practices for production-ready code 🛠 👉 Join now @repo_science and start building real-world projects like a pro!

#HaSab

@Hasab_2016 · Post #160 · 07.04.2025 г., 07:58

YES! 🙌 It's a wrap! 🥳 The HaraCoders Bootcamp training, brought to you by the awesome Rotaract Club of Kuriftu 🤝, BuildX Ethiopia , Sira Ale, and Addis Ababa University College of Veterinary Medicine and Agriculture , has been a HUGE success! We're sending out waves of gratitude to everyone involved and a BIG congrats to our fantastic trainees! 🎉 So proud of you all! 🔥 Stay tuned... round 2 might be closer than you think! 😉🚀 #AddisCoders#BuildXEthiopia#TechForAll#EmpowerTheFuture#CodingBootCamp#EthiopianTech#LearnToCode#CodingForChange #Rotary #Rackuriftu #100yearsofserviceinafrica #Rotaract #District9212 #RotaractEthiopia

#HaSab

@Hasab_2016 · Post #152 · 03.02.2025 г., 17:21

🚀 Exciting News! 🚀 The AddisCoders BootCamp is brought to you by BuildX Ethiopia in partnership with Rotaract Kuriftu, SERRALE, and Addis Ababa University! 🎓💻 Together, we’re empowering Ethiopian youth with hands-on web development skills to build the future of tech! 🔥 Stay tuned for more updates! #AddisCoders#BuildXEthiopia#TechForAll#EmpowerTheFuture#CodingBootCamp#EthiopianTech#LearnToCode#CodingForChange #Rotary #Rackuriftu #100yearsofserviceinafrica #Rotaract #District9212 #RotaractEthiopia

Repositorio data science

@repo_science · Post #3109 · 28.04.2023 г., 17:58

#datascientist#datascience#datasciencejobs#dataanalysis#data#dataanalyst#dataanalytics#dataanalystjobs#analytics#python#pythonprogramming#rprogramming#sql#excel#statistics#testing#softwaretesting#projects#projectmanagement#agile#computerscience#programming#webdevelopment#softwaredevelopment#roadmap#visualization#learningeveryday#learning#tutorials#learntocode#apache#powerbi#tableau#machinelearning#ml#ai#artficialintelligence#deeplearning#bigdata#bigdataanalytics#algorithms#mathematics#datastructures#kaggle#nlp#reinforcementlearning#sql#nosql#databases#mongodb ----- Canal principal:@repo_science Cupones: @freecoupons_reposcience -----