←back to thread

89 points Numerlor | 4 comments | | HN request time: 0s | source
1. AcerbicZero ◴[] No.41854032[source]
I have been "advocating" (i.e. complaining) for better REPLs basically the entire time I've been writing code - One of my favorite pasttimes is getting all flustered and trying to throw enough extensions and custom code to get an offline REPL.it style experience out of VS Code for whatever language I'm playing with at the moment, and lately its kinda been working (for Ruby, at least).

I am also very found of pointing out that Powershell still has one of the best ISE's/IDE's in the game for this kind of stuff. One window for editing, a terminal in which whatever you edit runs, and then access to every var/function/etc you just touched in that same terminal is a joyous experience that is shockingly hard to recreate for many languages. Hell half the time I'm just testing out random syntax or a portion of a function and being able to do that in the same session as the script I'm working is awesome.

With enough abuse VS code comes close (for Ruby at least, thank you Pry!) but it would be nice to get a similar experience with Python; I've used a few of the existing REPL options for python, but most of them require you to actually figure out pdb and even then it wasn't as tightly integrated as what I actually wanted.

replies(1): >>41854204 #
2. zahlman ◴[] No.41854204[source]
I usually just have one terminal window open with the Python REPL, and another open with a text editor. Works fine for me, although admittedly it was slightly more convenient back when `reload` was a builtin. (That's maybe the one thing I miss from 2.x, if I had to pick one. Sure, it doesn't honestly really make sense as a builtin; but it could have been added to `site` or something.)
replies(2): >>41854445 #>>41855154 #
3. banku_brougham ◴[] No.41854445[source]
ptpython is great in this usage
4. PyWoody ◴[] No.41855154[source]
Are you referring to the builtin `reload` found at `importlib.reload`? [0]

I use it all the time in debugging. Works great in conjunction with `breakpoint`s for quick iterations.

[0] https://docs.python.org/3/library/importlib.html#importlib.r...