0

I have been using Enthought Canopy for Python up until now. I really like that I can run a .py file, and play around with it in the Python Pane (e.g. make a class, and then play around in the Python Pane, trying to learn how it works, and how I can interact with it).

However, recently, I have fallen in love with pyCharm, specifically the autocomplete functions that Canopy lacks - and also the looks of it. However, when I run my program, there is no similar way of playing around with it afterwards.

David Cain
  • 16,484
  • 14
  • 65
  • 75
  • 1
    So you want the ironpython console? – Games Brainiac Jan 22 '14 at 16:45
  • What auto-complete functions are you referring to? (Canopy does have some tab completion, but it takes a while to scan the files the first time you use it in a given session.) – Jonathan March Jan 22 '14 at 23:40
  • @user3224363, you describing creating a class in the "Python Pane" andinteracting with it afterward in the "Python Pane." Python Pane isn't quite accurate, and the two panes of the Canopy user interface you're thinking of are different from each other. These would be Canopy's code editor in the first case and an iPython session in the second case. iPython is included in Enthought's Canopy distributions of Python but is actually different than Canopy and is not from Enthought. – Bennett Brown Oct 28 '14 at 18:31
  • What I usually do is edit my code in Pycharm and run it in Enthought. The opened file will automatically reload in Enthought after edits in Pycharm. This allows you to use the more advanced tab completion of Pycharm with the IPython console of Enthought. – camdenl Mar 06 '15 at 19:02

1 Answers1

1

Instead of running the file in PyCharm, debug it and set a breakpoint somewhere after your data structures are created. Then you can play in the console of the debugger just like you would in Canopy, and you can examine your variables in the variable window. Actually this is better than Canopy's editor in my opinion since you can also step through the code and see how it is changing your data and structures.

In PyCharm, so you don't have to make a project, use Control-Shift-R which builds a configuration for that file and runs it.

You are correct, once the process terminates, the variables are gone. You may also look at the Spyder IDE, as it works somewhat like the Canopy editor in this respect. But personally I love the PyCharm IDE best.

ZSG
  • 1,329
  • 14
  • 18
  • 1
    You can "step through the code and see how it is changing your data and structures" in Canopy. As of now that requires modifying your source code with `import pdb` and `pdb.set_trace()` at the breakpoint. https://docs.python.org/2/library/pdb.html Then use pdb commands to step, resume, examine values, reassign values, etc. The next Canopy release has a mouse-driven debugger akin to PyCharm, I'm told. – Bennett Brown Oct 28 '14 at 18:37