Hacker News new | comments | show | ask | jobs | submit login
Show HN: Pythonrc, now with ability to load virtualenv specific customizations (github.com)
12 points by devnonymous 7 days ago | hide | past | web | 12 comments | favorite

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.

Hi. Does this work on windows?

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.

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

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

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.

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.

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

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

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

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.

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 for an example.

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

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact