Closed jkokorian closed 7 years ago
I didn't yet succeed in automatically setting the file associations for .ipynb file (did it manually though, works perfectly), but I'm working on it. Haven't done that before...
I think entry_points requires setuptools, which I don't want to rely on (mainly for philosophical reasons - I hate setuptools). I think it should be possible to launch the application using commands like pyw -m nbopen file.ipynb
. I use a similar thing to produce shortcuts for applications with Pynsist.
Ah ok, I didn't realize. Weird that it works without additional imports though... I'll stick to the 'scripts' method then. Is there an easy distutils way to register the 'nbopen' file on linux, but the 'nbopen.py' file on windows that you know of?
If you install using pip, it automatically loads setuptools without an explicit import.
I think the simplest way is just to have an if sys.platform == 'win32'
check. The existing nbopen.py
should be usable directly as a script.
I've got Windows integration working in my VM - see commit cf0703e0d2a31dee4af86a53add47a5ee6ed5f2a for the new installation script.
For now I've skipped making nbopen
work at the command line, and just connected it directly to the GUI, so you can double click on files to open them. I may go back to it and make the command line tool work as well.
I didn't get it to work. I had to change import winreg to import _winreg because I have python 2.7, but it still didn't work. Probably because I already messed around with the file association myself...
I'll check if it works on a pc that I didn't mess up yet
It does work, nice! Now I just have to fix my own messed up registry...
Thanks for testing. I forgot about the naming difference on Python 2. I'll fix that at some point, or a PR to change it would be welcome.
Closing because nbopen is now packaged with flit instead.
The old way of having a console script failed on windows. This is the recommended way anyway, I believe.