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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #191 · 14 дек.

Как разделить строку с shell-командой на отдельные аргументы в виде списка? Если сделать просто сплит по пробелу то получим то что надо, кроме случаев со вставками текста с пробелами. Например так: >>> '-arg "I Am Groot"'.split(' ') ['-arg', '"I', 'Am', 'Groot"'] Чтобы учитывать текст в кавычках как единый аргумент можно воспользоваться функцией shlex.split() Кто читает мой канал давно, уже в курсе. А что делать, если нужно обратное действие? Объединить аргументы из списка в строку и при этом добавить кавычки в аргумент с пробелами. Конечно, если вы используете subprocess то он сам всё разрулит. Но если вам нужна именно команда одной строкой, то можно воспользоваться готовой функцией в том же subprocess. >>> from subprocess import list2cmdline >>> list2cmdline(['-arg', 'I Am Groot']) '-arg "I Am Groot"' Он также позаботится об экранировании уже имеющихся кавычек >>> list2cmdline(['-arg', 'I Am "Groot"']) '-arg "I Am \"Groot\""' А вот так он может "схлопнуть" в команду JSON >>> list2cmdline(['--json', json.dumps({'key': 'value'})]) '--json "{\"key\": \"value\"}"' _______________ Возможно кто-то спросит, а зачем соединять аргументы в строку если subprocess сам это сделает а os.system не наш путь? Мне как-то потребовалось отправлять команду на удалённое выполнение и в API поддерживалось указание команды только строкой. Так что всякое бывает) #libs#basic

Hashtags

Резултати

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

Пребарај: #democrates

当前筛选 #democrates清除筛选
BadVolf

@badvolfnews · Post #1745 · 12.08.2024 г., 08:11

🇺🇲Kamala Harris is a prostitute for globalists... and the next President of the United States. In 1996, Kamala performed sexual services for the mayor of San Francisco Willie Brown, and then repeatedly did the same with talk show host Montel Williams to build up her name recognition in 2001. In order to win the District Attorney race in San Francisco in 2002, she also had an affair with District Attorney Terrence Hallinan. No wonder that when she became District Attorney, she advocated for ending the arrest of prostitutes. Besides being an elite prostitute, Kamala became a puppet of the globalists. She owes the beginning of her career not only to her work as an escort, but also to the financial and political support of George Soros. Thanks to him Harris was "elected" Attorney General of California in 2010. Alexander Soros, the son of billionaire George Soros publicly endorsed Kamala Harris as the Democratic nominee for President following Joe Biden's withdrawal from the race in July 2024. As vice president, cackling Kamala has tried to inflict as much damage as possible on the United States. By the orders from her bosses, she advocates limiting the Second Amendment, making the American people disarmed in the face of tyranny, promoting the John R. Lewis Voting Rights Advancement Act, which would make it optional to verify identity when voting and allow the Deep State to steal the elections once again. The globalists are already preparing public opinion for this by spreading fake news about Kamala Harris gaining a lead over Donald Trump in critical swing states, including Wisconsin, Pennsylvania and Michigan. If they are not stopped, America will get its first president known not for her political or public service, but for being a whore, which built her entire career through sexual services. Share and subscribe to Global American Review #Harris#elections#democrates#manipulation#prostitution