paopaoka3325 commited on
Commit
34da184
·
1 Parent(s): 8a61219

add requiretment

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -11,7 +11,7 @@ def greet(name1, name2, name3, name4):
11
  with open('abstractsave.txt', 'w') as f:
12
  f.write(name4)
13
 
14
- def run_command(command):
15
  result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
16
 
17
  output_string = result.stdout
@@ -29,8 +29,30 @@ def greet(name1, name2, name3, name4):
29
 
30
  # output_string1, error_string1=run_command("poetry")# ontogpt")
31
 
 
32
  # For the purpose of this example, I'm just returning the values concatenated
33
  return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {output_string1},{error_string1},{output_string2},{error_string2},{output}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
  # Define 5 text input boxes with labels
36
  input_boxes = [
 
11
  with open('abstractsave.txt', 'w') as f:
12
  f.write(name4)
13
 
14
+ '''def run_command(command):
15
  result = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
16
 
17
  output_string = result.stdout
 
29
 
30
  # output_string1, error_string1=run_command("poetry")# ontogpt")
31
 
32
+
33
  # For the purpose of this example, I'm just returning the values concatenated
34
  return f"Inputs received: {str1}, {str2}, {str3}, {str4}, {output_string1},{error_string1},{output_string2},{error_string2},{output}"
35
+ '''
36
+
37
+
38
+ import site
39
+ import os
40
+
41
+ def get_package_location(package_name):
42
+ for directory in site.getsitepackages():
43
+ package_path = os.path.join(directory, package_name)
44
+ if os.path.exists(package_path):
45
+ return package_path
46
+ return None
47
+
48
+ package_name = "ontogpt" # You can replace this with any package name
49
+ location = get_package_location(package_name)
50
+ if location:
51
+ print(f"The install location for {package_name} is: {location}")
52
+ else:
53
+ print(f"{package_name} was not found.")
54
+
55
+ return location
56
 
57
  # Define 5 text input boxes with labels
58
  input_boxes = [