<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I want to assign the output of a bash shell command to a list value in IPython. But when I try it, I get this error.<br>
<br>
<br>
In [13]: a[1]=!ls<br>
------------------------------------------------------------<br>
File "<ipython console>", line 1<br>
a[1]=!ls<br>
^<br>
SyntaxError: invalid syntax<br>
<br>
This statement doesn't work either:<br>
a=len(!ls)<br>
<br>
But this one does work:<br>
a=!ls<br>
<br>
Can someone please explain how to get the other statements to work?</td></tr></table><br>