@PiniaCloudNotice · Post #6 · 21.06.2022 г., 17:10
◽️机场: #Pinia#Pinia Cloud(#皮娘) ◽️地址:前往官网Pinia群 💠特色: 1. 注册100 30天体验,IEPL线路,童叟无欺! 2. 夜间3点至早上9点,全站0.3倍率! 季付85折 折扣码:Pinia85 半年75折 折扣码:Pinia75 年付65折 折扣码:Pinia65 🍟套餐:10元100G 25元300G 38元500G
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
Пребарај: #pinia
@PiniaCloudNotice · Post #6 · 21.06.2022 г., 17:10
◽️机场: #Pinia#Pinia Cloud(#皮娘) ◽️地址:前往官网Pinia群 💠特色: 1. 注册100 30天体验,IEPL线路,童叟无欺! 2. 夜间3点至早上9点,全站0.3倍率! 季付85折 折扣码:Pinia85 半年75折 折扣码:Pinia75 年付65折 折扣码:Pinia65 🍟套餐:10元100G 25元300G 38元500G
@githubtrending · Post #15074 · 19.08.2025 г., 12:00
#vue#javascript#music#music_library#music_player#musicplayer#pinia#splayer#vite#vue#vue3 SPlayer is a simple, open-source music player designed mainly for Windows, built with modern web technologies like Vue 3 and Electron. It supports features like login via QR code or phone, daily check-ins, desktop lyrics, local music management, playlist creation, cloud music upload and playback, and even plays some songs without copyright restrictions. It offers light/dark themes, music spectrum visualization, and supports high-quality downloads if you have the right membership. You can deploy it locally or on servers using Docker or Vercel. This player is free for personal use and encourages community contributions, helping you enjoy and organize music easily with a customizable, modern interface. https://github.com/imsyy/SPlayer
@githubtrending · Post #14866 · 25.06.2025 г., 17:30
#typescript#admin#admin_template#elegant#naive_ui#naive_ui_admin#pinia#typescript#unocss#vite6#vue#vue_admin#vue3 SoybeanAdmin is a modern, elegant, and powerful backend management template built with the latest technologies like Vue3, Vite6, TypeScript, Pinia, and UnoCSS. It offers a clear project structure, strict code standards, automated file routing, and built-in internationalization. It supports flexible permission routing, rich page components, and mobile-friendly layouts, making it ready to use without extra setup. This helps you quickly build or learn advanced admin systems with high code quality and customization options, saving time and improving development efficiency. It also provides command-line tools and mock data support for easier development and testing[1][4][5]. https://github.com/soybeanjs/soybean-admin