Guest User

pipeline to sage

a guest
Jun 15th, 2016
152
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo -e "
  2. import numpy
  3. def fn():
  4.    return numpy.arange(3)
  5.  
  6. def fn2():
  7.    return fn()**2
  8.  
  9. print fn2()
  10. EOD
  11.  
  12. def fun():
  13.    return 5 * \
  14.           2
  15.  
  16. print fun()
  17. EOD
  18. " | while IFS='' read -r line; do
  19. if [[ "${line}" = "EOD" ]]; then
  20.     ~/Installations/sage/sage -c "${thecode}"; thecode=""
  21. else
  22.     thecode="${thecode}
  23. ${line}"
  24. fi
  25. done
  26. [0 1 4]
  27. 10
RAW Paste Data