DavidMoraP / NASA-APOD

Daily wallpaper change to NASA's APO
1 stars 1 forks source link

Path to save the image doesn't exist #3

Open miguelmoraperea opened 2 years ago

miguelmoraperea commented 2 years ago

When running the program I'm getting this error:

❯ python3 NASA_API.pyw
Traceback (most recent call last):
  File "NASA_API.pyw", line 22, in <module>
    with open(image_path, 'wb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'E:/Theseus/Pictures/NASA_APOD/2022_03_06_NASA_APOD.png'

This is because most users will not have an E:/Theseus/Pictures/ path in their computers.

To solve this, I recommend you look into using an environment variable instead.

Here is one resource: https://www.nylas.com/blog/making-use-of-environment-variables-in-python/

DavidMoraP commented 2 years ago

Hi Miguel,

I would love for you to check the current pull request and provide some feedback on that solution!

miguelmoraperea commented 2 years ago

Done, I sent you some feedback in the PR #5