3 ms·
Cool. Haven't looked at the code yet, but I wrote: https://github.com/Julian/dotfiles/blob/master/.config/python/rc.py#L53 https://github.com/Julian/dotfiles/
by JulianWasTaken 14y ago
Cool.
Haven't looked at the code yet, but I wrote:
https://github.com/Julian/dotfiles/blob/master/.config/python/rc.py#L53 https://github.com/Julian/dotfiles/blob/master/.config/pytho...
which does something similar (and is interpreter agnostic as it looks like this is).
- philipbjorge 14y agoMine's not interpreter agnostic because I had to mess with the stack frames to insert variables into the global context. But yours is able to do that because your importing a top-level edit function while I was pretty set on dynamically creating a vim() method and not having to import a function (just a module). I love how yours lists the globals though! I might just have to bite that feature :).
- JulianWasTaken 14y agoOh, yeah, well, importing stuff on interpreter startup is pretty much exactly what $PYTHONSTARTUP is for :).
- philipbjorge 14y agoAnd this is why I post code online - to find out the right way to do things. PYTHONSTARTUP is exactly 100% what I was looking for, but didn't know existed.