0

I have some python code for preprocessing/training . I have a shell script file (sample code below) that i would like to run from my python script.how can i run this script from my python main.py file ? also what file permissions should the my shell script needs to have?

main.py

import os
import subprocess
import venv

venv.create('a_venv', with_pip=True) 

##invoke shell script here

somescript.sh

#!/bin/bash
set -e
echo "how to run this"
....do something 
arve
  • 569
  • 2
  • 10
  • 27
  • 1
    **Side-note:** The fact that it is running on an Amazon ECC2 instance is not relevant. EC2 instances run the same operating system as a 'normal' computer. – John Rotenstein Jun 08 '23 at 04:16
  • @JohnRotenstein - one thing i noticed one difference, running same code in ec2 is that , in my pyhon code , i create a virtual environment with venv library and the flag with_pip is set to true( updated code in my question) , in ec2 i dont see pip installed where as in my local machine , the pip is available under my virtual environment created with my code. i can' t find out why is that – arve Jun 08 '23 at 12:23

0 Answers0