Lately, I’ve developed a practice of creating an “interact.py” file near the code that I’m working on. I put imports, some magic values, and helpers there that I need while fiddling with things. Then, I just run `$python -i interact.py`. This is my local way of dealing with the same frustration, and I haven’t thought about more general approach yet. That’s interesting.
Hey this is pretty awesome, I didn't know this existed at all. I like your script as well, there are some useful utilities in there. I have two questions:
- On line 266 you say setting this aliases makes JSON NOT valid Python, but I get the feeling it is the other way around. Is that correct? If it works like I think it works then it is a smart trick!
- Do you think I can expect this to work everywhere, or would certain IDEs like Pycharm perhaps use their own startup scripts overwriting my own? Pycharm has a pretty nice built-in REPL for instance.
Good catch on the typo, I meant "is now", one letter, everything changes :)
As for pycharm, I don't know of any IDE that add their own startup script. Some injects things in the REPL, but they use another mechanism for this so you should be fine. Haven't started instaled pycharm for a good year now so I haven't tested it but it seems logical.
Lately, I’ve developed a practice of creating an “interact.py” file near the code that I’m working on. I put imports, some magic values, and helpers there that I need while fiddling with things. Then, I just run `$python -i interact.py`. This is my local way of dealing with the same frustration, and I haven’t thought about more general approach yet. That’s interesting.
Hey this is pretty awesome, I didn't know this existed at all. I like your script as well, there are some useful utilities in there. I have two questions:
- On line 266 you say setting this aliases makes JSON NOT valid Python, but I get the feeling it is the other way around. Is that correct? If it works like I think it works then it is a smart trick!
- Do you think I can expect this to work everywhere, or would certain IDEs like Pycharm perhaps use their own startup scripts overwriting my own? Pycharm has a pretty nice built-in REPL for instance.
Thanks, glad you like it. Believe it or not, it has been take down by reddit (https://www.reddit.com/r/Python/comments/13m86df/happiness_is_a_good_pythonstartup_script), so apparently some people didn't like it has much ^^
Good catch on the typo, I meant "is now", one letter, everything changes :)
As for pycharm, I don't know of any IDE that add their own startup script. Some injects things in the REPL, but they use another mechanism for this so you should be fine. Haven't started instaled pycharm for a good year now so I haven't tested it but it seems logical.