Adrit Rao commited on
Commit
c4a862b
1 Parent(s): 9a029c3

Add application file v2

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -5,15 +5,26 @@ import zipfile
5
  import os
6
  import subprocess
7
 
8
- # Define the commands
9
  commands = [
 
 
 
10
  "conda init",
 
11
  "cd Comp2Comp-main",
12
- "conda create -n c2c_env python=3.8",
13
  "conda activate c2c_env",
14
  "pip install -e ."
15
  ]
16
 
 
 
 
 
 
 
 
17
  # Run the commands
18
  for command in commands:
19
  try:
 
5
  import os
6
  import subprocess
7
 
8
+ # Define the list of commands, including "echo" to simulate Enter keypress
9
  commands = [
10
+ "wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh",
11
+ "bash miniconda.sh -b -p /path/to/miniconda",
12
+ "echo", # Simulate pressing Enter
13
  "conda init",
14
+ "echo", # Simulate pressing Enter
15
  "cd Comp2Comp-main",
16
+ "conda create -n c2c_env python=3.8 -y", # Automatically answer yes with -y
17
  "conda activate c2c_env",
18
  "pip install -e ."
19
  ]
20
 
21
+ for command in commands:
22
+ try:
23
+ subprocess.run(command, shell=True, check=True)
24
+ except subprocess.CalledProcessError as e:
25
+ print(f"Error running the command: {e}")
26
+
27
+
28
  # Run the commands
29
  for command in commands:
30
  try: