79123174

Date: 2024-10-24 18:07:54
Score: 1
Natty:
Report link

For anyone in the future, you can do the following:

import os
path = os.path.dirname(os.path.realpath(__file__))

Now you have the path to the current python file. You can access files like so:

f = open( os.path.join(path, 'static/logo.png'), 'rb' )
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: David Song