А знаете ли вы, что в Bash есть особая переменная "$_" ? Из описания можно узнать, что в переменную "$_" помещается последний аргумент последней команды.
Что-то знакомое? Конечно, в Python есть примерно тоже самое.
Мы знаем, что дата первого релиза Bash (8 июня 1989) несколько раньше чем первый релиз Python (20 февраля 1991). Если учесть, что по задумке автора Python это агрегация самых успешных практик отовсюду, можно ли сказать что именно эта фишка к нему пришла из Bash? Ни подтверждения ни опровержения я пока не нашел.
Давайте просто считать это совпадением 😉
А как это может быть полезно в Bash?
Приведу простой пример, который оценят те, кто часто работает в терминале.
Допустим, нам надо создать директорию и зайти в неё. Что обычно делаем?
:~$ mkdir foldername
:~$ cd foldername
:~/foldername$
Как это сделать в одну команду?
:~$ mkdir foldername && cd foldername
:~/foldername$
Уже лучше, но хочется короче, без повторов. Вот тут и пригодится наша переменная. Напомню, что в неё сохраняется последний аргумент предыдущей команды.
:~$ mkdir foldername && cd $_
:~/foldername$
_________________
PS.
Символы "&&"" разделяют команды и означают, что требуется выполнить вторую команду только если первая завершилась успешно.
#linux#tricks
https://docs.python.org/3/library/marshal.html#module-marshal
marshal — Internal Python #object_serialization
This module contains functions that can read and write Python values in a binary format. The format is specific to Python, but independent of machine architecture issues (e.g., you can write a #Python value to a #file on a PC, transport the file to a Sun, and read it back there). Details of the format are undocumented on purpose; it may change between Python versions (although it rarely does).
@thefavbot
Qué puede hacer este bot?
Este bot puede recopilar todos sus medios en un solo lugar.
Usted puede acceder a sus medios favoritos en cualquier chat!
Para eso debes escribir @thefavbot en el chat que deseas. Soporta:
Foto, video, archivo, audio, voz, gif.
Para agregar cualquier medio a su colección, solo necesita enviarlo o reenviarlo al bot.
Idioma: Inglés
(visto en @BotsGram_cu)
#gift, #video, #image, #file
#Musicopy#Music#File#Transfer
Join the Musicopy: Music File Transfer beta on ✈️#TestFlight
🔗 Link: https://testflight.apple.com/join/Ck9KaZVR
Shared by Dimitri
Sharing
Share files and apps on android to other devices using browser
Share files and apps over HTTP.
You need the other device to be connected to the same network. just toggle on the server and scan the QR Code on other device and you're good to go. Files sent from browser to the app can be found in Sharing/ folder in your internal storage. You can always disable uploads in the app settings.
https://github.com/Ammar64/Sharing
Download
https://github.com/Ammar64/Sharing/releases/latest
https://f-droid.org/packages/com.ammar.sharing/
#share#file#Transfer#Android#qr
@warlockpublicurl_bot
Qué puede hacer este bot?
Envíale cualquier Archivo Multimedia de Telegram y generará un enlace directo para ello
Los Archivos Porno están Estrictamente Prohibidos.
Idioma: Inglés
(visto en @BotsGram_cu)
#file, #upload, #link, #url, #public, #telegram