find and zip all .py files with bash

Create a Zip folder including all .py files on your computer.

via Find and Zip All .py Files — Data Science for Engineers

 

not to be obtuse, its a good demo of pythons capabilities; but it didnt take very long to figure out this one-liner to do more or less the same:

echo found $(find . -name '*.py' -print0 | 
xargs -0 zip all-python-source-files.zip -@ | wc -l) 'file(s)'

 

 

Advertisements

2 thoughts on “find and zip all .py files with bash

    1. i totally agree. sometimes im willing to do a bash script partly in python or fig as a demo– however, if the result is 10x more complex then i just put the one-liner here, if possible:

      x “#one liner goes here” shell # or arrshell, which makes output go to an array

      Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s