vendredi 16 avril 2021

How to manage path to files for testing modules?

I have a small project with the following directory tree:

enter image description here

The paths to access to 'sets.txt' and 'copy3.png' are referenced to 'main.py'. However, I would like to run standalone the view to test placement issues or adjustments. Doing so will lead to FileNotFound exception. Should I have a variable to set when the view is in 'test mode'?

Which would be the best way to handle the paths?

Aucun commentaire:

Enregistrer un commentaire