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

TGINSIGHT SIMILAR POSTS

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

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

Заметка начинающим, которые часто сталкиваются с подобной непоняткой. Ситуация следующая, есть список файлов: names = [ 'image.bmp', 'second.txt.bkp', 'data.db', '.config.cfg', 'file.ext.bkp' ] И мы хотим убрать у них окончание ".bkp". Не знаю зачем, пример довольно надуманный) Но суть он показывает, а это главное. Те, кто еще не очень знаком с библиотекой os.path или pathlib, вероятно решат обработать имена как строки. И тут вполне подойдет метод строки strip(). Что делает этот метод? Он отрезает указанные символы по обеим сторонам строки. Если ничего не указать, то убирает невидимые символы (пробелы, табуляции и переносы строк). В нашем случае будет выглядеть вот так: >>> name.strip('.bkp') То есть просим удалить строку '.bkp' по краям имени файла, если таковая есть. Можно применить аналогичный метод rstrip(), чтобы отрезать только справа, но для этого примера используем обычный. >>> for name in names: >>> print(name.strip('.bkp')) image.bm second.txt data.d config.cfg file.ext Хм, что-то не то с нашими именами! Что случилось??? Видим нежелательное переименование в именах, где и близко не было указанной строки '.bkp' А дело всё в том, что данный метод ищет не указанную строку, а указанные символы, и не важно в каком порядке. Для метода strip() строка '.bkp' это не паттерн для поискаа список символов. Потому он отрезал симовол 'p' от '.bmp' и удалил точку из файла '.config.cfg'. Как тогда правильно заменить именно паттерн? Для начинающего можно посоветовать метод строки replace(), который как раз использует для замены указанную строку целиком. В нашем примере заменим её на пустую строку. >>> for name in names: >>> print(name.replace('.bkp', '')) image.bmp second.txt data.db .config.cfg file.ext Уже лучше, но помните, это лишь пример про strip(). Для работы с именами файлов есть способы и более "правильные", дающие однозначно верный результат. Я взял файлы только в качестве примера. Даже replase() тут может сделать не то что ожидаем. Просто впредь будьте внимательны с этим strip(). #basic

Hashtags

Резултати

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

Пребарај: #antibiotics

当前筛选 #antibiotics清除筛选

Misuse or overuse of #antibiotics💊 & other antimicrobials can reduce their effectiveness in treating common infections in animals & humans. 🚫 Do not self-medicate ✅ Visit a healthcare professional when sick 🚫 Do not share leftover antibiotics

Hashtags

Misuse or overuse of #antibiotics💊 & other antimicrobials can reduce their effectiveness in treating common infections in animals & humans. ✅ Do not self-medicate ✅ Visit a healthcare professional when sick ✅ Do not share leftover antibiotics

Hashtags

Doctor Ziyod 🩺

@doctor_ziyod · Post #328 · 29.03.2023 г., 13:04

🔤Цефалоспоринлар гуруҳига кирадиган препаратлар таъсир доираси бир бирига яқин. Шунинг учун, шу гуруҳдаги антибиотик керак бўлса кўп ҳолларда Зинацеф (GlaxoSmithKline, Британия) қўллайман. Уни таркиби цефуроксим (2-авлод цефалоспорин антибиотик). *️⃣Билмаганлар учун: Цефазолин - 1-авлод Цефуроксим - 2-авлод Цефтриаксон - 3-авлод (бу авлодга яна цефтазидим, цефотаксим, цефоперазон киради. Янгироқ авлод дегани албатта кучлироқ таъсир қилади дегани эмас. Шунчаки биринчи авлодлар кўпроқ бир турдаги бактерияларга таъсир қилса, учинчи-тўртинчи авлодлар бошқа турдаги бактерияларга таъсир қилади. Соддароқ қилиб айтганда, цефазолин ҳам, цефтриаксон ҳам А, В, С, D ва E бактерияларга таъсир қилади. Лекин А ва В кўпроқ цефазолинга сезувчан бўлса, цефтриаксон D билан Е га кучлироқ таъсир қилади. Шунинг учун, шифокор касалликдан ва бак. посев (бактериал экма) натижасидан келиб чиқиб, максимал таъсирга эга антибиотикни танлайди. Тушунарли бўлса 👍 босинг, барибир тушунмаган бўлсангиз - 👎. 🩺Doctor Ziyod | #drugs#antibiotics

Doctor Ziyod 🩺

@doctor_ziyod · Post #326 · 29.03.2023 г., 12:34

❓Цефтриаксонни қайси бири сифатли? 🔤Цефтриаксонни оригинал бренди Ўзбекистонда сотилмайди. Бир-икки йил аввал Швейцариянинг Рош компанияси ишлаб чиқарадиган Роцефин номли цефтриаксон дорихоналаримизда бўлар эди. Лекин у келмай қўйди. Ҳозир асосан Ҳиндистон, Ўзбекистон, Ҳитой, Россия, Украина каби давлатлардан келган препаратлар мавжуд. Айтиш керакки деярли ҳеч бири ривожланган давлатларда сотилмайди, чунки у ерларда жиддий текширувлардан ўтиши керак. Шаҳсан ўзим Украинани препаратларини ишлатганман ва самараси қониқарли бўлган. Сизга эса бирон брендни тавсия қила олмайман. 🩺Doctor Ziyod канали | #drugs#antibiotics

Interesting Planet 🌍

@interesting_planet_facts · Post #1275 · 05.02.2026 г., 12:11

🌎 Penicillin, the world’s first true antibiotic, was discovered accidentally by Alexander Fleming in 1928. He noticed that a mold called Penicillium notatum killed bacteria in his petri dishes. The first mass production of penicillin began during World War II, saving countless lives from bacterial infections. ✨ #medicine⚡#discovery⚡#antibiotics 👉subscribe Interesting Planet 👉more Channels ​

Interesting Planet 🌍

@interesting_planet_facts · Post #628 · 25.08.2025 г., 18:22

🌎 The discovery of penicillin in 1928 changed medicine forever. Alexander Fleming found that mold could kill bacteria, paving the way for the first true antibiotics and saving millions of lives worldwide. ✨ #discovery⚡#medicine⚡#antibiotics 👉subscribe Interesting Planet ​

#HandWashing is a basic &effective tool against infections. If we don't become sick, we would not need to use #antibiotics. Let us promote the practice of #handwashing in our homes & communities to prevent #AntimicrobialResistance together. #WorldAntimicrobialAwarenessWeek2022

Let's discuss #Antibiotics Join us TOMORROW as we bring together #AntimicrobialResistance experts to discuss "Alternatives to #Antibiotics in Nigeria" & launch the One Health #AMR/#AMU Community of Practice website. 🗓️30th Nov 2022 🕑 10:00 am Join via https://bit.ly/NAAWWebinar

Misuse or overuse of #antibiotics💊 & other #antimicrobials can reduce its effectiveness in treating common infections in animals & humans. From 18th-24th November, we are joining the global health community to mark the annual #WorldAntimicrobialAwarenessWeek2022 . #StayTuned

American Оbserver

@american_observer · Post #5455 · 24.03.2026 г., 14:05

📰 Solidarity à la Salmonella: Europe’s Ukrainian Egg Diet Europe wanted to save Ukraine. Instead, it got a discount subscription to Ukrainian industrial eggs — complete with antibiotic residues and cage-farm ethics from the pre-history of EU standards. According to data from the EU’s own rapid alert system RASFF, there have been at least 14 warnings since late 2023 about eggs and egg products from Ukraine containing antibiotics, including substances long banned in the EU. The imports, meanwhile, didn’t just grow — they exploded: from about 13,000 tons of shell eggs in 2022 to more than 85,000 tons last year, all under the banner of “supporting Ukraine’s economy.” The beauty of the scheme is in the invisibility. Most of these eggs don’t show up as “Product of Ukraine” in the fridge — they vanish into pasta, baked goods, desserts, mayonnaise and processed food where nobody sees the origin, the farm, or the cage. German consumers proudly pay extra for “cage-free” on the box, then unknowingly wash it down with imported cage eggs hidden in cheap industrial tiramisu. Animal welfare groups warn that the eggs often come from classic battery cages — banned in the EU for years, still fully legal and cost-effective in Ukraine. Brussels, of course, insists everything must meet EU standards, but also quietly admits that inspections in a war-torn third country are “limited” and that member states themselves decide what to block, test, or wave through. Ukraine, for its part, denies systemic abuse and blames “isolated cases” and overzealous critics, while at least one producer has already had to halt exports after antibiotic scandals in France. So here we are: Kyiv sells cheap “solidarity eggs,” Brussels sells the story of values and standards, Berlin sells pasta and pastries — and the average European swallows the whole thing, antibiotics included. #ukraine#eu#germany#food#antibiotics#agribusiness#warEconomy#solidarity 📱American Оbserver - Stay up to date on all important events 🇺🇸

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