7

I'd like to know if drop frame is available in PyCharm / Intellij with Python plugin.

Here's what the button looks like (it doesn't show up on the debug toolbar so I assume it's just not available for PyCharm) --> How to step one step back in IntelliJ?

What I'm trying to do is to re-play a function when I see a problem, to inspect it more. ("come back in time")

(I've used this before in Eclipse with Java, it would replay the current scope if you edited it and saved changes. of course the global scope remains changed after running a function many times, but for most cases it's very useful)

Thanks for telling!

Dorian Turba
  • 3,260
  • 3
  • 23
  • 67
Nick463
  • 225
  • 2
  • 11

3 Answers3

4

As of version 2017.3.3, there is no drop frame feature as that in IntelliJ. The pycharm docs referred above seems wrong.

ying
  • 628
  • 1
  • 7
  • 16
  • If you run your script within python console, you can achieve semi-refresh by pausing somewhere else. Then interpreter will reload the changed file other than the paused script. – ying Mar 13 '18 at 02:17
-1

Since you want to 're-ply a function', 'Evaluate Expression' works great for that purpose. I use a lot when I debug. It basically allows to run any code at runtime with the variables and functions in that context.

It is the icon on the most right on the debug window.

Put a break point on the line before the line where goes wrong, debug the program, when it tops on the break point, click on 'Evaluate Expression' icon, copy the function with issues, paste it and run it.

Alec Zhang
  • 129
  • 6
  • Thanks pretty neat! Good for now, it's a better console. You can mouse over variables after the snippet completed, but can't put breakpoints or run line by line. I hope Jetbrains implement replay for PyCharm soon. Anyhow thanks for the tip! – Nick463 Nov 19 '15 at 05:47
  • 2
    drop frame is different from evaluate expression at all. – ying Jan 24 '18 at 16:46
  • It is different but it could be used to evaluate the function we are in, from the same parameters, which may respond to the same needs as drop frame. – user118967 Apr 15 '20 at 07:57
-2

PyCharm 2017.2 seems to have added the functionality you're looking for. The documentation describes a "Drop frame button" on the Debug Stepping Toolbar:

Interrupts execution and returns to the initial point of method execution. In the process, it drops the current method frames from the stack.

howanu
  • 36
  • 3
  • 2
    According to [this IntelliJ post](https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000707984--Drop-Frame-button-missing-Pycharm-2017-2-4-Professional-), @ying is correct: the PyCharm documentation referenced above is wrong and Jump to Cursor can be used as a workaround as of version 2017.3. The post contains a link for those who are interested in following the status of the "Drop to Frame" feature request. – howanu Jul 10 '18 at 20:58
  • You should make this comment an answer. You'd get my upvote. – Noumenon Oct 24 '19 at 00:02