Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

run python script inside bash script

#/bin/bash
#append python script to file
tee .tempfile.py >/dev/null <<EOF
#!/bin/env python3
from scipy import integrate
x2 = lambda x: x**2
print(integrate.quad(x2, 0, 4))
EOF
#execute using python
python3 .tempfile.py
#remove file after exectution
rm -rf .tempfile.py
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #run #python #script #bash #script
ADD COMMENT
Topic
Name
4+4 =