3 ms·
> /usr/bin/pythonx Maybe /usr/bin/sensible-python or /etc/alternatives/python?
by teddyh 5y ago
> /usr/bin/pythonx
Maybe /usr/bin/sensible-python or /etc/alternatives/python?
- kazinator 5y agoThe sensible-python name carries connotations which are not there; this link could be any version of python whatsoever and differ from installation to installation. That version of python is not necessarily "sensible" compared to the others. Nor is writing in a reduced Python subset more sensible than using newer features; it's just different tradeoffs. The Debian-style alternatives mechanism could work here. I had that in the back of my mind when I wrote the comment, but I wasn't sure whether or not it's already buggered in some way by the Python2/3 thing. (Like if there are multiple Python2 packages somehow, using /etc/alternatives/python to have the semantics of which of the two is the preferred Python2.) If the /etc/alternatives/python name is available, it could be used this way: the preferred python (for running code that isn't specific to any python version). It works this way for some existing programs. For instance /etc/alternatives/yacc could be GNU Bison or Berkeley Yacc. Either implementation does not handle some inputs that the other does, and there is a POSIX yacc subset of the yacc language that should work with both. If you have a very plain yacc file that conforms to POSIX and stays away from corner cases in the spec, it should just work with the yacc command.