You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the code to generate. :
Write a code to display WWV time
Python Code
import requests
def display_wwv_time():
try:
response = requests.get('https://time.nist.gov:13')
if response.status_code == 200:
time_data = response.text.strip()
print(f"The current WWV time is: {time_data}")
else:
print("Failed to fetch WWV time.")
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
display_wwv_time()
Error message
An error occurred: HTTPSConnectionPool(host='time.nist.gov', port=13): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1007)')))
The text was updated successfully, but these errors were encountered:
I'm not sure what has been wrong with your generation or if there is anything that we can really fix (we don't control what is generated, we just control the input not the output)
Error msg:
Traceback (most recent call last):
File "/workspaces/Coding/Display WWV time", line 31, in
print("WWV Time:", data['dateTime'])
TypeError: string indices must be integers
Considering all the parameters that you control thru portal -
What do you want me to do?
Description of the code to generate. :
Write a code to display WWV time
Python Code
import requests
def display_wwv_time():
try:
response = requests.get('https://time.nist.gov:13')
if response.status_code == 200:
time_data = response.text.strip()
print(f"The current WWV time is: {time_data}")
else:
print("Failed to fetch WWV time.")
except requests.exceptions.RequestException as e:
print(f"An error occurred: {e}")
display_wwv_time()
Error message
An error occurred: HTTPSConnectionPool(host='time.nist.gov', port=13): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1007)')))
The text was updated successfully, but these errors were encountered: