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

Резултати

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

Пребарај: #aicontent

当前筛选 #aicontent清除筛选
AI & Law

@ai_and_law · Post #256 · 07.03.2024 г., 08:04

Mozilla Foundation Study Raises Concerns on Watermarking AI Content Hello everyone! In a study released by the Mozilla Foundation, the challenges of identifying synthetic content online have been brought to light. Titled "In Transparency We Trust? Evaluating Watermarking and Labeling AI-Generated Content," the study delves into the effectiveness of various methods, including watermarking and labeling, in differentiating between synthetic and authentic content. The study, which conducted a comprehensive assessment of seven methods, both machine-readable and human-facing, revealed alarming findings: none of the methods were rated as "good," indicating significant hurdles in accurately identifying synthetic content. Despite efforts to implement watermarking and labeling, the study underscores the persistent difficulties faced in combatting the proliferation of AI-generated content. #MozillaFoundation#AIContent#Watermarking

ВЕРШИНИН

@neuro_ver · Post #121 · 17.12.2024 г., 04:53

Меньше недели я потратил на изучение генеративных моделей, и вот что уже получается. Задумка, усидчивость и терпение, конечно, важны. Результат может быть невероятным. #AIVideo#GenerativeAI#RunwayML#AIContent#PikaLabs#CreativeAI#ContentCreation#TechInnovation#DigitalArt#FutureOfContent

Crypto M - Crypto News

@CryptoM · Post #64833 · 10.04.2026 г., 03:04

🚀 WeChat Updates Guidelines to Prohibit Automated Content Creation WeChat has updated its 'Public Account Behavior Guidelines' to include a new rule prohibiting non-human automated content creation. According to Foresight News, the new guideline, Article 3.27, specifically bans the use of artificial intelligence for generating, rewriting, splicing, or transporting content, as well as the bulk or continuous publication of content through scripts or program hosting. It also prohibits the dissemination of tutorials, methods, or services related to non-human automated creation. WeChat clarified that AI can be used as an auxiliary tool for tasks such as sentence refinement, error correction, icon generation, and information retrieval. However, the final content must reflect the style, stance, and judgment of a real creator. Violations of these guidelines may result in traffic restrictions, content deletion, or account suspension. A significant number of accounts have already been deleted or banned due to bulk AI-generated content. Previously, on March 10, Xiaohongshu announced measures to combat AI-managed accounts. #WeChat#AIContent#ContentGuidelines#AutomatedContent#AccountSuspension#AIRegulation#SocialMediaPolicy#ContentModeration#DigitalCompliance#Xiaohongshu