2 ms·
Wait, what is the syntax for this? I can't do `len(!ls)`?
by thomasahle 10y ago
Wait, what is the syntax for this? I can't do `len(!ls)`?
- carreau 10y agoNo, `!command` only work on assignment. Please read http://ipython.readthedocs.io/en/stable/interactive/tutorial.html http://ipython.readthedocs.io/en/stable/interactive/tutorial... See tutos like https://www.youtube.com/watch?v=xe_ATRmw0KM https://www.youtube.com/watch?v=xe_ATRmw0KM , most of what works in the notebook work in IPython. But yes you can do things like: files = ! ls *.txt for name in files: with open(name) as f: if 'Content-Type: text/x-rst' in f.read(): !git mv {name} {name[:-3]}rst