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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #83 · 11 мај

У строки в Python есть два очень похожих метода. На столько похожих что кажется они делают одно и тоже. Это метод isdigit() и isnumeric() Давайте посмотрим зачем нам два одинаковых метода? И так ли они одинаковы? Очевидно что isdigit() говорит нам, состоит ли строка только из чисел 0-9 >>> '12'.isdigit() True >>> '12x'.isdigit() False >>> '-12'.isdigit() False >>> '12.5'.isdigit() False Можно предположить что isnumeric() делает более глубокий анализ и распознаёт в строке float или отрицательное число. >>> '15'.isnumeric() True >>> '-15'.isnumeric() False >>> '15.2'.isnumeric() False Нет, всё так же как и с другим методом. В чем же тогда разница? Для начала посмотрим следующие примеры: >>> '5'.isdigit(), '5'.isnumeric() # Обычная цифра 5 # True, True >>> '꧕'.isdigit(), '꧕'.isnumeric() # Яванская 5 # True, True >>> '෩'.isdigit(), '෩'.isnumeric() # Синхала 3 # True, True >>> '৩'.isdigit(), '৩'.isnumeric() # Бенгальская 3 # True, True >>> '༣'.isdigit(), '༣'.isnumeric() # Тибетская 3 # True, True >>> '³'.isdigit(), '³'.isnumeric() # 3 верхний индекс (степень) # True, True >>> '𝟝'.isdigit(), '𝟝'.isnumeric() # Математическая двойная 5 # True, True >>> '๔'.isdigit(), '๔'.isnumeric() # Тайская 4 # True, True >>> '➑'.isdigit(), '➑'.isnumeric() # 8 в круге # True, True А теперь примеры в которых, по мнению Python, результаты не равны >>> '¾'.isdigit(), '¾'.isnumeric() # дробь три четверти # False, True >>> '⅕'.isdigit(), '⅕'.isnumeric() # дробь одна пятая # False, True >>> '𒐶'.isdigit(), '𒐶'.isnumeric() # клинопись 3 # False, True >>> '三'.isdigit(), '三'.isnumeric() # 3 из унифицированной идеограммы # False, True >>> '⑩'.isdigit(), '⑩'.isnumeric() # цифра 10 в круге # False, True >>> 'Ⅳ'.isdigit(), 'Ⅳ'.isnumeric() # Римская 4 # False, True >>> '𑇪'.isdigit(), '𑇪'.isnumeric() # Сенегальская архаическая 10 # False, True >>> '𐌢'.isdigit(), '𐌢'.isnumeric() # Этрусская цифра 10 # False, True >>> 'ↂ'.isdigit(), 'ↂ'.isnumeric() # Римская цифра 10000 # False, True >>> '〇'.isdigit(), '〇'.isnumeric() # Символ ККЯ ноль # False, True Получается, что isdigit() говорит нам, является ли символ десятичной цифрой или спецсимволом, имеющим цифирное значение после преобразования. В свою очередь isnumeric() включает все дополнительные символы юникода которые имеют отношения к числовым и цифровым представлениям. Ну и пара примеров в которых в обоих случаях символ не является числом, это эмодзи. >>> '🕙'.isdigit(), '🕙'.isnumeric() # эмодзи 10 часов # False, False >>> '7️⃣'.isdigit(), '7️⃣'.isnumeric() # эмодзи 7 # False, False Также есть еще один дополнительный и весьма полезный метод isdecimal(). Он нам сообщает, можно ли из указанного символа сделать простую десятичную цифру. То есть сработает ли метод int(x) >>> '෩'.isdecimal(), int('෩') # Синхала 3 # True, 3 >>> '➑'.isdecimal(), int('➑') # 8 в круге # False, ValueError Какие выводы? 🔸 При определении цифры в строке isdigit() подходит лучше чем isnumeric(), но оба не гарантируют успешную конвертацию в int 🔸 Для однозначного определения возможности преобразования строки в int лучше подходит метод isdecimal() 🔸 Для однозначного определения символов 0...9 лучше использовать regex Полный список символов юникода которые определяются как numeric #basic

Hashtags

Резултати

Пронајдени 1,016 слични објави

Пребарај: #proxy

当前筛选 #proxy清除筛选
轩辕节点分享吧

@fq521 · Post #4135 · 06.05.2026 г., 01:39

#proxy telegram内置代理 10条 tg://socks?server=47.239.147.84&port=3060&user=123&pass=123 tg://socks?server=47.239.172.228&port=3060&user=123&pass=123 tg://socks?server=47.239.159.70&port=3060&user=123&pass=123 tg://socks?server=47.239.159.125&port=3060&user=123&pass=123 tg://socks?server=47.239.158.189&port=3060&user=123&pass=123 tg://socks?server=47.239.158.45&port=3060&user=123&pass=123 tg://socks?server=47.239.105.135&port=3060&user=123&pass=123 tg://socks?server=43.100.108.223&port=3060&user=123&pass=123 tg://socks?server=47.239.134.180&port=3060&user=123&pass=123 tg://socks?server=47.239.142.122&port=3060&user=123&pass=123 tg://socks?server=47.239.162.1&port=3060&user=123&pass=123 tg://socks?server=47.239.164.100&port=3060&user=123&pass=123

Hashtags

轩辕节点分享吧

@fq521 · Post #4128 · 04.05.2026 г., 00:44

#proxy telegram内置代理 10条 tg://socks?server=47.239.147.84&port=3060&user=123&pass=123 tg://socks?server=47.239.172.228&port=3060&user=123&pass=123 tg://socks?server=47.239.159.70&port=3060&user=123&pass=123 tg://socks?server=47.239.159.125&port=3060&user=123&pass=123 tg://socks?server=47.239.158.189&port=3060&user=123&pass=123 tg://socks?server=47.239.158.45&port=3060&user=123&pass=123 tg://socks?server=47.239.105.135&port=3060&user=123&pass=123 tg://socks?server=43.100.108.223&port=3060&user=123&pass=123 tg://socks?server=47.239.134.180&port=3060&user=123&pass=123 tg://socks?server=47.239.142.122&port=3060&user=123&pass=123 tg://socks?server=47.239.162.1&port=3060&user=123&pass=123 tg://socks?server=47.239.164.100&port=3060&user=123&pass=123

Hashtags

BotsGram®

@botsgram_cu · Post #4127 · 20.07.2021 г., 01:49

¿Que puede hacer este bot? @hqproxy_bot Este bot te proporciona extensas listas actualizadas de varios tipos de proxys para Telegram y otras plataformas. Idioma: inglés (Visto en @botsgram_cu) #proxy

Hashtags

📓 Real Spencer Woo

@realSpencerWoo · Post #146 · 02.04.2020 г., 06:06

#GitHub#Proxy#Cloudflare 📥 加速 GitHub 文件下载 —gh-proxy GitHub | Demo GitHub 最近访问越来越随缘了,而 GitHub Release 又是直接存储在 AWS 上的,对国内的同学来说访问更慢。gh-proxy 是一个利用 Cloudflare Workers 对 GitHub Release、Archive 和项目文件进行加速的服务,同时也支持加速 git clone 项目。 实际用下来,演示地址(就是上面的 demo)就可以让国内同学无代理直接下载 GitHub 内容,网络环境好的情况下,速度非常可观。(不过还是没有直接挂代理快。)推荐大家用来帮助其他没有特殊条件(我不是,我没有,别瞎说)的同学下载 GitHub 内容,方便所有同学直接下载一些仅在 GitHub Release 上发布的软件等。 📮 Via channel: @realSpencerWoo

Libreware

@libreware · Post #932 · 26.04.2021 г., 12:17

SagerNet ---- a universal proxy tool for Android Supported proxy protocols: SOCKS, Shadowsocks, SSR, VMess, VLESS, Trojan. Supported subscription protocols: Universal Base64 format, Shadowsocks SIP008, Clash. A week ago, due to dissatisfaction that almost all agents on Android are closed source (except shadowsocks-android); already closed source and pretending to be open source (v2rayNG), I started to make this tool. The difference between basic functions and shadowsocks-android: no log and tracking components, no closed source dependency, v2ray replaces the built-in simple routing and traffic statistics. The difference between the basic function and v2rayNG: v2rayNG's function is not perfect, the code is not good-looking, and now it is fake open source (. In addition, we have also made a China Apps scanner for sub-application agents (based on DEX path scanning, identifying the characteristics of the SDK, tracking components, and reinforcement programs of major domestic manufacturers, and it is close to practical after small-scale testing) Other features: agent grouping, display modification when subscribing to update, etc. Project address: https://github.com/nekohasekai/SagerNet The first beta version is now released, and you can download it from GitHub Release https://github.com/nekohasekai/SagerNet/releases/ or Telegram channel https://t.me/SagerNetApks (compiled and released via GitHub Actions). For more introduction and compilation, please check Github Repo~ Don't forget to click a star If there is a crash or other problem, please export the application log on the about page and send it to the discussion group of this channel. Feedback is welcome ~ #sagernet#proxy @sagernet

123•••5•••10•••15•••20•••25•••30•••35•••40•••45•••50•••55•••60•••65•••70•••75•••80•••8485
ПретходнаСтраница 1 од 85Следна