Inara132000 commited on
Commit
00bfe96
·
verified ·
1 Parent(s): 639d80a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -1,6 +1,10 @@
1
  from deliverable2 import URLValidator
2
  import os
3
  import json
 
 
 
 
4
 
5
  # Retrieve API key from environment variables
6
  SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")
@@ -53,4 +57,4 @@ for query, url in zip(queries, urls):
53
  })
54
 
55
  # Print formatted output
56
- print(json.dumps(results, indent=2))
 
1
  from deliverable2 import URLValidator
2
  import os
3
  import json
4
+ from dotenv import load_dotenv
5
+
6
+ # Load environment variables from a .env file (if present)
7
+ load_dotenv()
8
 
9
  # Retrieve API key from environment variables
10
  SERPAPI_API_KEY = os.getenv("SERPAPI_API_KEY")
 
57
  })
58
 
59
  # Print formatted output
60
+ print(json.dumps(results, indent=2))