Is there a possibility to run extended IPython (which can be used in interactive console, see example) non-interactively as a script? I haven't found it documented anywhere.
Example:
#!/magical/ipython/command --that-i-want
from __future__ import print_function
d = !date +%s
!echo $d.s $(($d.s / 1000))
files = !ls -A
for i, f in enumerate(files):
print("File number %s is '%s'" % (i, f))
Expected output should be: (result of copy&pasting to IPython interactive console)
1463917269 1463917
File number 0 is '.ipynb_checkpoints'
File number 1 is 'file1.txt'
File number 2 is 'file2.txt'
When shebang is ipython it fails with:
d = !date +%s
^
SyntaxError: invalid syntax
runipy, I'm interested in ipython as a scripting language.