Skip to content
Advertisement

Running for loop terminal commands in Jupyter

I know how to run command line in Jupyter : using ! For example, run an image file 2.jpg on Python process.py

JavaScript

Question is, how to process all files of a folder in iteration way (idx) in Jupyter cell, something like this:

JavaScript

Thanks

PS: I tried path , did not work:

JavaScript

Advertisement

Answer

A possible hackish solution could be to use eval and let bash execute a string.

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement