
Show HN: Pythonrc, now with ability to load virtualenv specific customizations - devnonymous
https://github.com/lonetwin/pythonrc/
======
devnonymous
I've submitted this before a couple of times over the last couple of years but
re-submitting now because I've added a few interesting (at least I think so)
enhancements. The '\l' command to list the code for objects and now the '\e'
command will also let you ^edit^ objects (ie: open the source file for objects
in the editor). Also the ability to load and _pre-populate_ your sessions when
working in virtualenvs.

Would love to hear feedback or ideas. Hope at least some people find it as
useful as I do.

~~~
philipov
Hi. Does this work on windows?

~~~
devnonymous
Not sure to be honest. I've developed, tested and used this only on linux
(various flavors). That said, I can't think of reasons why it shouldn't except
for maybe the terminal color sequences. Not sure how compatible those are.

I'd love to hear whether it does. If it doesn't it would be good to get bug
reports or pull requests.

~~~
sashk
It shouldn't be hard to add windows support with colorama[1].

[1]:
[https://pypi.python.org/pypi/colorama](https://pypi.python.org/pypi/colorama)

~~~
devnonymous
Thanks. One of the (personal) goals for this was to keep it simple all in one
file (that's why the code is 540 lines with comments and help and license
text) and be dependent only on the stdlib.

This lets me just copy it over (using the bash function I have shown in the
demo) everywhere I ssh without having to pip install anything. Additionally it
just works out of the box for any virtualenv ...even something created with
mktmpenv.

Of course, if someone doesn't feel the same, they are encouraged to make this
their own ! I've put in effort to ensure the code is easy to read and modify.

~~~
sashk
you can always hide colorama's import and initialization behind try: except
ImportError block, which will allow it to work when it's available, and skip
when it's not.

------
photonios
You could shorten the demonstration in the README a bit by avoiding the
explanations. Most of it is quite obvious.

~~~
devnonymous
Yeah, I guess it _is_ a bit long. I'll redo the demo soon. Thanks for the
feedback.

------
hprotagonist
Can you make it do presentations for you like dave beazely? ;)

~~~
devnonymous
I'm not sure what you mean. Do you have an example ? If you are speaking about
creating screencasts, I've been thinking about creating a script that'll load
a text file, replay it on an prompt and generate the asciinema json based off
that. Something like a mix of except, typescript and asciinema.

~~~
hprotagonist
Sorry, kind of a joke. Dave Beazley is well-known to give talks with a
_heavily_ modded interpreter. See
[https://www.youtube.com/watch?v=lyDLAutA88s](https://www.youtube.com/watch?v=lyDLAutA88s)
for an example.

~~~
devnonymous
Hah! Didn't watch the entire video yet but I get it.

For sure, that doesn't seem like a hard thing to do. Maybe I will make a tool
like that to do live presentations! Looks like fun.

/Me going back to watch that video

