I'm working with scripts in jupyter notebooks. For code clarity, I would like to 'outsource' some definitions into a second script. But there are umlaute, 'ü's, 'ä's, 'ö's and others, in the definitions. Definitions look like this:
an_outsourced_dict = {'Hello': 'Hallo', 'Door': 'Tür'}
After running into problems with 'importing' the second script with importlib, I'm now just running
%run myotherscript.ipynb
in the first script and have access to whatever is defined in myotherscript.ipynb afterwards.
The problem:
Content of an_outsourced_dict
in the calling script is {'Door': 'Tür', 'Hello': 'Hallo'}
, and an_outsourced_dict['Door'] == 'Tür'
returns False
.
Also, when I add a print(an_outsourced_dict) in mysecondscript.ipynb, it will print 'Tür' as well, when called via %run. But defining and printing it from the main script gives a 'Tür'.
(How) Can this be solved? For now I'll just put everything in one script.
This seems related, but my problem is not about writing anything to a file.
Additional information:
Python version 3.5, trying to get the ipython version as described here also gives an encoding error :) and I'm on Windows (8.1)