Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test code - Not Working - Display WWV time #29

Open
sabina1122 opened this issue Jan 1, 2024 · 2 comments
Open

Test code - Not Working - Display WWV time #29

sabina1122 opened this issue Jan 1, 2024 · 2 comments
Assignees

Comments

@sabina1122
Copy link

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)')))

@JonathanMagnan JonathanMagnan self-assigned this Jan 1, 2024
@JonathanMagnan
Copy link
Member

JonathanMagnan commented Jan 1, 2024

Hello @sabina1122 ,

On my side, it looks to work fine: https://zzzcode.ai/code-generator?id=05e94afb-b7dd-4014-ad9e-0d4fd13a02c5

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)

Best Regards,

Jon

@sabina1122
Copy link
Author

Hello Jon!
Actually, this is interesting. I tried again with the same set of instructions.

https://zzzcode.ai/python/code-generator?id=8885da94-90ac-415b-b0e0-2ad7f1179ef4

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants