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

Резултати

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

Пребарај: #issues

当前筛选 #issues清除筛选
UzCSD | Markaziy depozitariy

@uzcsd · Post #2837 · 18.11.2022 г., 14:04

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2093, while of corporate bonds totaled 30 as of 18.11.2022. The aggregate volume of issued shares totaled UZS 165 622.4 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2821 · 11.11.2022 г., 13:04

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2092, while of corporate bonds totaled 30 as of 11.11.2022. The aggregate volume of issued shares totaled UZS 165 616.4 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2800 · 04.11.2022 г., 14:33

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2091, while of corporate bonds totaled 30 as of 04.11.2022. The aggregate volume of issued shares totaled UZS 165 616.2 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2786 · 28.10.2022 г., 13:34

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2090, while of corporate bonds totaled 30 as of 28.10.2022. The aggregate volume of issued shares totaled UZS 165 616.2 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2778 · 21.10.2022 г., 15:04

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2085, while of corporate bonds totaled 30 as of 21.10.2022. The aggregate volume of issued shares totaled UZS 164 689.5 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2763 · 14.10.2022 г., 14:49

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2084, while of corporate bonds totaled 30 as of 14.10.2022. The aggregate volume of issued shares totaled UZS 164 619.5 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2746 · 07.10.2022 г., 13:24

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2083, while of corporate bonds totaled 30 as of 07.10.2022. The aggregate volume of issued shares totaled UZS 164 609.8 billion, while of corporate bonds totaled UZS 1 011.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2727 · 30.09.2022 г., 15:04

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2082, while of corporate bonds totaled 29 as of 30.09.2022. The aggregate volume of issued shares totaled UZS 164 597.6 billion, while of corporate bonds totaled UZS 1006.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2719 · 23.09.2022 г., 15:04

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2081, while of corporate bonds totaled 29 as of 23.09.2022. The aggregate volume of issued shares totaled UZS 164 397.9 billion, while of corporate bonds totaled UZS 1006.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2711 · 17.09.2022 г., 04:02

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2079, while of corporate bonds totaled 27 as of 16.09.2022. The aggregate volume of issued shares totaled UZS 163 200.5 billion, while of corporate bonds totaled UZS 996.4 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2691 · 09.09.2022 г., 14:33

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2078, while of corporate bonds totaled 26 as of 09.09.2022. The aggregate volume of issued shares totaled UZS 163 200.4 billion, while of corporate bonds totaled UZS 993.9 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

UzCSD | Markaziy depozitariy

@uzcsd · Post #2674 · 26.08.2022 г., 14:16

End-of-week depositary statistics OVERVIEW OF SECURITIES ISSUES SAFEKEPT BY THE CENTRAL SECURITIES DEPOSITORY The aggregate number of shares issues totaled 2077, while of corporate bonds totaled 25 as of 26 August 2022. The aggregate volume of issued shares totaled UZS 163 190.4 billion, while of corporate bonds totaled UZS 983.9 billion. #issues#shares#bonds#infographics#statistics deponet.uz|Tg|Fb|Inst|Youtube

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