human
How to reliably open a file in the same directory as a Python script
assistant
Here is some code to open a file 'bundled-resource.jpg' in the same directory as a python script

f = open(os.path.join(__location__, 'bundled-resource.jpg'))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.