For python files I can get the file name and use to as a prefix for the generated results using:
prefix = os.path.splitext(os.path.basename(main.__file__))[0]
But this fails for ipython notebooks with the following error:
---> 23 return os.path.splitext(os.path.basename(main.__file__))[0]AttributeError: module '__main__' has no attribute '__file__'
Is there a reasonable way to get the current notebook's name?
Previously suggested solutions, like ipyparams and ipynbname don't seem to work for me.