@social_justice_watch · Post #17881 · 09.02.2023 г., 17:47
Sorry for what, exactly? 👀#Autism#autistic#ActuallyAutistic#AutismAcceptance#AutismAcceptancesource
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
Пребарај: #autistic
@social_justice_watch · Post #17881 · 09.02.2023 г., 17:47
Sorry for what, exactly? 👀#Autism#autistic#ActuallyAutistic#AutismAcceptance#AutismAcceptancesource
@social_justice_watch · Post #17904 · 09.02.2023 г., 18:42
Betcha it would improve accessibility AND accuracy. Just sayin'. #Autism#autistic#ActuallyAutistic#autistictwittersource
@social_justice_watch · Post #18048 · 28.04.2023 г., 14:30
Gets me going every time. #Autism#autistic#ActuallyAutistic#pathologicaldemandavoidancesource
@social_justice_watch · Post #18054 · 02.05.2023 г., 19:17
It’s only a real choice if it’s a fully informed one. Identity First Language = Autistic person, am/is Autistic Person First Language = person with Autism, have/has Autism #autism#autistic#ActuallyAutistic#Autisticmemessource
@social_justice_watch · Post #17919 · 14.02.2023 г., 16:55
Maybe you’re not doing it wrong, you just haven’t found someone who gets you yet. ❤️ #Autism#autistic#ActuallyAutistic#autistichumorsource
@social_justice_watch · Post #17905 · 09.02.2023 г., 18:44
And this is one of the many reasons why self-identification is a thing. (Applicable to ADHDers as well.) #Autism#autistic#ActuallyAutistic#ADHD#AuDHDsource
@social_justice_watch · Post #18016 · 05.04.2023 г., 18:45
You can’t win, so why give them any of your f@cks? 😉 #autism#Autistic#ActuallyAutistic#AutismAcceptance#AutismAwarenesssource
@social_justice_watch · Post #18035 · 18.04.2023 г., 22:21
Actual footage. #pathologicaldemandavoidance#pervasivedriveforautonomy#autistic#ActuallyAutisticsource
@social_justice_watch · Post #18119 · 29.06.2023 г., 04:39
For some reason, even people who understand the importance of representation for other groups can struggle to apply the same logic to Autistic (and otherwise disabled) people. <cough cough #ableism> #autistic#ActuallyAutistic#nothingaboutuswithoutussource
@social_justice_watch · Post #18060 · 09.05.2023 г., 21:39
If your first instinct is to dismiss this on the grounds of “but that would be really messed up,” you’re about halfway to the point. Keep going. #Autism#autistic#ActuallyAutistic#AutismAcceptance#appliedbehavioranalysissource
@social_justice_watch · Post #17909 · 09.02.2023 г., 19:02
CW: ABA, signs of trauma. I don’t normally do content warnings, but ngl: this one just hurts. Take care of yourself and scroll on by if you’re not in the right space for it. (And I promise I’ll make it up to you next week.) #Autism#Autistic#ActuallyAutistic#ABA#banABAsource
@social_justice_watch · Post #17968 · 07.03.2023 г., 22:50
Ableist stereotypes are bullshit. Also, we know our neurokin when we see them. 👀😉 #Autism#autistic#ActuallyAutistic#AuDHD#Neurodivergent#AutismAcceptancesource