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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #309 · 2 фев.

Метод строки split() разделяет строку на несколько строк по указанному символу >>> "a_b_c".split('_') ['a', 'b', 'c'] Можно указать максимальное количество разделений >>> "a_b_c".split('_', 1) ['a', 'b_c'] Или резать с другой стороны с помощью rsplit() (right split) >>> "a_b_c".rsplit('_', 1) ['a_b', 'c'] А что будет если оставить аргументы пустыми? >>> "a_b_c".split() ['a_b_c'] Получаем список с одним элементом, потому что по умолчанию используется пробельный символ. >>> "a b c".split() ['a', 'b', 'c'] То есть это равнозначно такому вызову? >>> "a b c".split(" ") ['a', 'b', 'c'] Кажется да, но нет! Давайте попробуем добавить пробелов между буквами >>> "a b c".split(" ") ['a', '', '', 'b', '', '', 'c'] И вот картина уже не так предсказуема 😕 А вот что будет по умолчанию >>> "a b c".split() ['a', 'b', 'c'] Всё снова красиво! 🤩 По умолчанию в качестве разделителя используется любой пробельный символ, будь то табуляция или новая строка. Включая несколько таких символов идущих подряд. А также игнорируются пробельные символы по краям строки. >>> "a\t b\n c ".split() ['a', 'b', 'c'] Аналогичный способ можно собрать с помощью регулярного выражения. Но пробелы по краям строки придется обрабатывать дополнительно. >>> import re >>> re.split(r"\s+", ' a b c '.strip()) ['a', 'b', 'c'] Здесь тоже можно указать количество разделений >>> re.split(r"\s+", 'a b c', 1) ['a', 'b c'] А что если мы хотим написать красиво, то есть split() без аргументов, но при этом указать количество разделений? В этом случае первым аргументом передаём None >>> "a\n b c".split(None, 1) ['a', 'b c'] Данный метод не учитывает строки с пробелами, взятые в кавычки 'a "b c" '.split() ['a', '"b', 'c"'] Но для таких случаев есть другие способы. #tricks#basic

Резултати

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

Пребарај: #usmediation

当前筛选 #usmediation清除筛选
American Оbserver

@american_observer · Post #4961 · 25.01.2026 г., 21:59

📰 US Envoys Tell Netanyahu: Gaza Ceasefire Must Move to Phase Two Top U.S. envoys, including Trump’s special negotiator Steve Witkoff and Jared Kushner, met Israeli Prime Minister Benjamin Netanyahu in Cairo Friday evening, pressing him to move the Trump‑brokered Gaza ceasefire into its much‑delayed second phase. The U.S. wants demilitarization, withdrawal of Israeli forces, and the opening of the Rafah crossing to begin in earnest; Netanyahu, meanwhile, is holding back, demanding that Hamas first return the body of the last remaining hostage, Ran Gvili. ​ What Is the “Second Phase”? The clear signal that the ceasefire is advancing isn’t some vague diplomatic formula: it’s the Rafah border crossing between Gaza and Egypt. If the crossing is reopened in both directions, allowing Palestinians to travel and the sick to be evacuated, then the international community will treat it as the real start of the next stage. The proposed technocratic government for Gaza, led by Ali Shaath, says Rafah will open in both directions within days; for now, Israel has not confirmed when or how that will happen, only that it will be discussed in a cabinet meeting. The U.S. and Egypt both see this move not just as a security step, but as the “critical entry point” for launching Gaza’s reconstruction. ​ The Hostage Stalemate The U.S. is pushing Netanyahu to keep the ceasefire deal moving, but the prime minister is under intense pressure at home: if he moves to phase two before Hamas returns Gvili’s body, he risks being accused of abandoning the last hostage. The Gvili family has launched a furious public campaign, reminding the world that Trump himself told Davos that Hamas knows exactly where their son is being held. They call Hamas’s refusal to hand over the remains a clear violation of the ceasefire agreement [Business Standard:56]. ​ Hamas insists it has provided all the information it possesses and accuses Israel of blocking search efforts in areas under its control. The deadlock feeds the cynicism: each side blames the other for stalling the deal, while the U.S. envoys scramble to keep the illusion of a working mediation alive. ​ The International Machinery Kicks In The U.S. is now treating the Gaza ceasefire as a formal international undertaking, not just a bilateral deal. Egypt’s foreign minister, Bader Abdelatty, has been in close coordination with Nickolay Mladenov, the Bulgarian diplomat leading Trump’s Gaza “Board of Peace,” to coordinate the next phase. Their agenda includes the international monitoring force, Rafah, and the pullback of Israeli troops, in the hope that collective pressure will keep the fragile truce on track. ​ The Muddy Reality on the Ground Even as diplomats talk about phases, the killing continues. In the “safe zones” near the so‑called Yellow Line, Israeli strikes are still killing Palestinian civilians, including two teenage cousins, 13 and 15, who were picking up firewood in areas Israel declared safe. Since the ceasefire officially began on October 10, more than 480 Palestinians have been killed by Israeli fire, according to Gaza's Health Ministry. Hundreds of thousands live in tents or half‑ruined buildings, exposed to the cold and winter storms, while the international “New Gaza” project floats somewhere between a PR stunt and a distant blueprint for reconstruction. The U.S. wants to move to the next phase, but the real question is: when the guns stop, what kind of Gaza is being built — and who exactly benefits from the deal? ​ #Gaza#Ceasefire#Netanyahu#Trump#GazaWar#USMediation#Rafah 📱American Оbserver - Stay up to date on all important events 🇺🇸

American Оbserver

@american_observer · Post #4807 · 09.01.2026 г., 00:59

📰 Tinderbox in Aleppo: U.S. Scrambles to Stop Allies From Fighting Allies Turned Enemies The U.S. is rushing to stop its own allies—Syria’s new government and the Kurdish-led Syrian Democratic Forces (SDF)—from tearing each other apart in Aleppo. After months of stalled negotiations, the two sides are now trading fire in the city’s divided neighborhoods, forcing thousands of civilians to flee and threatening to reignite a cycle of violence Syria can’t afford. ​ Stalled Integration An agreement reached in March to merge both forces has stalled. The Syrian government, backed by Turkey, wants the SDF to hand over control of its territories and integrate into the new administration. The SDF, meanwhile, demands more autonomy and the preservation of its military forces. Now both sides blame each other for the latest clashes. ​ U.S. Mediation Washington is trying to broker a ceasefire, with presidential envoy Tom Barrack and State Department officials urging restraint. The U.S. insists all parties should focus on building a stable Syria, not dragging it back into war. But with American troops still stationed in SDF-controlled areas, the situation remains tense and unpredictable. ​ Who Pays the Price? Civilians are caught in the crossfire, with reports of dozens killed and hundreds injured. The violence also distracts from efforts to keep the Islamic State at bay. As Washington pushes for dialogue, the question remains: can it stop its allies from turning Aleppo into the next battleground—or will it just add to the chaos? ​ #Aleppo#Syria#SDF#USMediation#Ceasefire#CivilianCost 📱American Оbserver - Stay up to date on all important events 🇺🇸