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

TGINSIGHT SIMILAR POSTS

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

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

Ранее я делал серию постов про битовые операторы. Вот вам ещё один наглядный пример как это используется в Python в модуле re. Чтобы указать флаг для компилятора нам надо указать его после передаваемой строки. Например, добавляем флаг для игнорирования переноса строки. pattern = re.compile(r"(\w+)+") words = pattern.search(text, re.DOTALL) А как указать несколько флагов? Ведь явно будут ситуации когда нам потребуется больше одного. Кто читал посты по битовые операторы уже понял как. pattern.search(text, re.DOTALL | re.VERBOSE) А теперь смотрим исходники, что находится в этих атрибутах? Не удивительно, степени двойки. Почему? Потому что каждое следующее значение это сдвиг единицы влево. >>> for n in [1, 2, 4, 8, 16, 32, 64, 128, 256]: >>> print(bin(n)) 0b1 0b10 0b100 0b1000 0b10000 0b100000 0b1000000 0b10000000 0b100000000 Чтобы было понятней, давайте напишем тоже самое но иначе, добавим ведущие нули: 000000001 000000010 000000100 000001000 000010000 000100000 001000000 010000000 100000000 Не понятно что тут происходит? Читай три поста про битовые операторы начиная с этого ➡️https://t.me/pythonotes/45 В общем, это пример применения побитовых операций в самом Python. Теперь вы знаете Python еще немного лучше) #tricks#regex#libs

Резултати

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

Пребарај: #invention

当前筛选 #invention清除筛选
Interesting Planet 🌍

@interesting_planet_facts · Post #1239 · 20.01.2026 г., 12:11

🌎 In 1843, Scottish inventor Alexander Bain patented the first electric clock. His design used electromagnetic pendulums powered by batteries, revolutionizing timekeeping accuracy for railways and industry. By 1845, electric clocks began synchronizing city tower clocks in England. ✨ #invention⚡#history⚡#technology 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1094 · 02.12.2025 г., 22:11

🌎 The accidental invention of Velcro came after Swiss engineer George de Mestral examined burrs stuck to his dog in 1941. He found their hooks could inspire a new fastening system. Velcro's tiny hooks and loops mimic burrs’ natural grip, and it is now widely used in clothing, space suits, and shoes. ✨ #invention⚡#history⚡#engineering 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #749 · 14.09.2025 г., 16:22

🌎 X-rays, discovered by Wilhelm Röntgen in 1895, revealed the hidden structure of the human body without surgery. The first X-ray image was of Röntgen’s wife’s hand, showing her bones and wedding ring. ✨ #history⚡#invention⚡#medicine 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1064 · 23.11.2025 г., 12:11

🌎 The first practical electric light bulb was invented by Thomas Edison in 1879. Edison’s design used a carbon filament inside a vacuum bulb, which could glow for over 1,200 hours before burning out. ✨ #invention⚡#history⚡#electricity 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #656 · 30.08.2025 г., 13:22

🌎 A single spark started the Age of Electricity—when Michael Faraday discovered electromagnetic induction in 1831. This breakthrough showed how moving magnets can create electric current, laying the groundwork for generators, motors, and our modern electric world. ✨ #invention⚡#history⚡#electricity 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1124 · 12.12.2025 г., 22:11

🌎 Before the invention of the printing press, books had to be copied by hand, a process taking months or even years per copy. In 1440, Johannes Gutenberg developed the first movable type printing press in Germany, revolutionizing the spread of knowledge. The first major book he printed was the Gutenberg Bible, completed around 1455 and containing 1,282 pages. ✨ #printing⚡#history⚡#invention 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #684 · 04.09.2025 г., 00:22

🌎 The printing press, invented by Johannes Gutenberg around 1440, revolutionized how information spread. Movable metal type allowed fast, affordable book production—leading to the first mass communication and fueling the European Renaissance. ✨ #invention⚡#history⚡#printing 👉subscribe Interesting Planet ​

Interesting Planet 🌍

@interesting_planet_facts · Post #914 · 15.10.2025 г., 20:11

🌎 The accidental discovery of Teflon happened in 1938 when chemist Roy Plunkett was trying to make refrigerants. Instead, he found a slippery, nonreactive solid—polytetrafluoroethylene, now used for nonstick cookware and medical devices. The first Teflon-coated pan was produced in France in 1954. ✨ #invention⚡#chemistry⚡#materials 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #1351 · 24.03.2026 г., 12:11

🌎 The MRI (Magnetic Resonance Imaging) machine was invented in the 1970s by Raymond Damadian, Paul Lauterbur, and Peter Mansfield. MRI uses strong magnets and radio waves to produce detailed images of organs and tissues inside the body, without using X-rays. The first full-body MRI scan was completed in 1977. ✨ #invention⚡#medicine⚡#imaging 👉subscribe Interesting Planet 👉more Channels ​

Google Facts™ [ ️@googlefactss🌎]

@googlefactss · Post #41008 · 03.05.2026 г., 22:01

Fredric Baur invented the Pringles can. He died on May 4, 2008, at age 89. At his request, some of his ashes were buried in an Original flavor Pringles container. 🫙❤️ [Source] @googlefactss #Pringles#Invention#FunFact#FredricBaur If you have ideas or feedback contact us: @Googlefactss_Feedback_bot

12
ПретходнаСтраница 1 од 2Следна