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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #199 · 8 јан.

Многие из тех кто активно работал с Python2 несколько удивлены, почему в Python3 удобная функция reload() переехала из builtin в imp а потом и в importlib? Ну было же удобно! А теперь лишний импорт😖 Дело в том, что начиная с Python3.3 функция reload() переписана на Python вместо Cи. Что это нам даёт? 🔸 Такой код проще поддерживать и развивать 🔸 Python код легче читать, изучать и понимать. Сравните это ➡️ и это ➡️. 🔸 Как результат пункта 2, проще писать свои расширения импорта. Например, пользовательский импортёр с какой-либо хитрой логикой по аналогии с импортом из zip архивов. А есть ли у этого решения недостатки? Да, они всегда есть. 🔹 Так как это не builtin функция, её следует импортнуть перед использованием 🔹 Скорость замедлилась примерно на 5%. Очевидно, что это совершенно не критично. К тому же от версии к версии логика импорта будет оптимизироваться и ускоряться. В самом начале файла importlib/__init__.py мы видим такой импорт: import _imp # Just the builtin component, NOT the full Python module То есть часть функционала по прежнему написана на Си, но достаточно низкоуровневая. #basic

Hashtags

Резултати

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

Пребарај: #webhook

当前筛选 #webhook清除筛选
djangoproject

@djangoproject · Post #121 · 25.08.2016 г., 04:39

https://gist.github.com/leandrotoledo/4e9362acdc5db33ae16c # This file is an annotated example of a #webhook based #bot for #telegram. It does not do anything useful, other than provide a quick # template for whipping up a testbot. Basically, fill in the CONFIG # section and run it. # Dependencies (use pip to install them): # - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot # - Flask : http://flask.pocoo.org/ # Self-signed SSL certificate (make sure 'Common Name' matches your FQDN): # $ openssl req -new -x509 -nodes -newkey rsa:1024 -keyout server.key -out server.crt -days 3650 # You can test SSL handshake running this script and trying to connect using wget: # $ wget -O /dev/null https://$HOST:$PORT/

探索号

@seeker_rc · Post #19936 · 08.05.2026 г., 02:25

开发了个简单的 ping-pong+监控的小软件 软件有三个功能: 1. 启动时会访问设置好的 webhook (目的:在系统启动成功或母机意外重启时给自己发一条通知,能及时知道) 2. 启动一个 ping-pong http 服务,默认端口 10101 (目的:可以让另外一台主机检测本机是否运行正常) 3. 可以监控一个或多个设定的 url (一个简单的定检测功能,可以监控给定的 url 是否正常运行,如果访问失败,会请求前面设定的 webhook ,并支持修改参数) github: <https://github.com/yafoo/ping-pong> 如果你有这方面需求可以试试。 ... via V2EX 分享创造 标签: #ping#pong#webhook ⚡️探索号频道 ⚡️探索者频道 ⚡️探索者交流群 ⚡️ Youtube 频道:科技探索者 每天推荐有趣内容,欢迎订阅、转发。

djangoproject

@djangoproject · Post #122 · 25.08.2016 г., 04:45

https://github.com/python-telegram-bot/python-telegram-bot/wiki/Webhooks#heroku On #Heroku using #webhook can be beneficial on the free-plan because it will automatically manage the downtime required. The reverse proxy is set up for you and an environment is created. From this environment you will have to extract the port the #bot is supposed to listen on. Heroku manages the #SSL on the #proxy side, so you don't have provide the certificate yourself.