@botsgram_cu · Post #3153 · 23.11.2020 г., 18:55
Qué puede hacer este bot? @PromoPedidoBot Con este bot puedes hacer un pedido o solicitud de promoción Idioma: Portugués (visto en @botsgram.cu) #publicaciones
Hashtags
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
Пребарај: #publicaciones
@botsgram_cu · Post #3153 · 23.11.2020 г., 18:55
Qué puede hacer este bot? @PromoPedidoBot Con este bot puedes hacer un pedido o solicitud de promoción Idioma: Portugués (visto en @botsgram.cu) #publicaciones
Hashtags
@botsgram_cu · Post #4140 · 25.07.2021 г., 18:02
¿Que puede hacer este bot? @ChannelToGroupsBot Con este bot puedes reenviar todos los mensajes enviados en un canal establecido a todos los grupos con el bot Idiomas: varios incluido español (Visto en @botsgram_cu) #publicaciones#grupos#canales
Hashtags
@botsgram_cu · Post #4119 · 17.07.2021 г., 08:28
¿Que puede hacer este bot? @ChannelToChannelBot Este bot le permitirá tener automáticamente todas las publicaciones de su canal reenviadas a un canal de respaldo Idiomas: varios incluido español (Visto en @botsgram_cu) #canales#publicaciones#herramientas
@botsgram_cu · Post #4572 · 26.12.2021 г., 22:22
¿Que puede hacer este bot? @ViewBoosterBot Con éste bot puedes aumentar las vistas de las publicaciones de tu canal. Idiomas: inglés (Visto en @botsgram_cu) #vistas#publicaciones#canales
Hashtags
@botsgram_cu · Post #3103 · 02.11.2020 г., 18:29
¿Que puede hacer este bot? @Autoforward_Nsbot Este bot puede reenviar mensajes de un canal a otro y agregar el título automáticamente. Idioma: inglés (Visto en @botsgram_cu) #mensajes#publicaciones#canales#herramientas
@botsgram_cu · Post #4573 · 27.12.2021 г., 04:26
¿Que puede hacer este bot? @todoeasybot Perfecto para hacer listas. Debes añadirlo como Administrador a un canal privado o público. Este bot proporcionará a cada publicación dos botones: uno de "Hecho" y otro de "Cancelar" Idiomas: inglés (Visto en @botsgram_cu) #listas#publicaciones#canales
Hashtags
@botsgram_cu · Post #3811 · 15.04.2021 г., 03:09
¿Que puede hacer este bot? @MediaEditorRoBot Este bot ayuda a los administradores de canales a editar publicaciones multimedia Simplemente envíe un mensaje de medios al bot y reenvíe una publicación de canal al bot, luego el bot reemplazará la publicación con los medios enviados por el usuario Idioma: inglés (Visto en @botsgram_cu) #canales#herramientas#multimedia#publicaciones
@botsgram_cu · Post #4149 · 27.07.2021 г., 15:17
¿Que puede hacer este bot? @AJviewCounter_bot Bot para programar alarmas en dependencia de la cantidad de vistas obtenidas en un mensaje. Idioma: español (Visto en @botsgram_cu) #alarma#publicaciones#vistas
Hashtags