paopaoka3325 commited on
Commit
00ad5c1
·
1 Parent(s): 86e8ab3

add requiretment

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -32,19 +32,19 @@ def greet(name1, name2, name3, name4):
32
 
33
 
34
 
35
- # import subprocess
36
-
37
- # def get_package_location(package_name):
38
- # try:
39
- # result = subprocess.check_output(["pip", "show", package_name], text=True)
40
- # for line in result.splitlines():
41
- # if line.startswith("Location:"):
42
- # return line.split(":")[1].strip()
43
- # except:
44
- # return 'not found'
45
-
46
- # package_name = "ontogpt" # Replace this with any package name
47
- # location = get_package_location(package_name)
48
 
49
  # return location
50
  # For the purpose of this example, I'm just returning the values concatenated
 
32
 
33
 
34
 
35
+ import subprocess
36
+
37
+ def get_package_location(package_name):
38
+ try:
39
+ result = subprocess.check_output(["pip", "show", package_name], text=True)
40
+ for line in result.splitlines():
41
+ if line.startswith("Location:"):
42
+ return line.split(":")[1].strip()
43
+ except:
44
+ return 'not found'
45
+
46
+ package_name = "ontogpt" # Replace this with any package name
47
+ location = get_package_location(package_name)
48
 
49
  # return location
50
  # For the purpose of this example, I'm just returning the values concatenated