PyScripter annoyances and general find & replace gripes


I had used PyScripter last year in the development of a Pylons web app and generally seemed to be up to the task; however, for my current work I’m running into to some issues I had not noticed previously:

  1. Internal interpreter (bad) state – I can find no way to clear the state of the IDE’s internal Python interpreter (the clear command just appear to clear the interpreter window only) so if it gets variables into a bad state you have to clear them with code or more simply just close and restart the IDE. UPDATE: Per PyScripter’s comment below I gave using a remote engine a shot to work around this (this requires installing Remote Python Call). It does work fine for running my single file, but my full application is unable to import __main__ in this environment and fails to load as a result (neither WingIDE and Komodo IDE nor have this issue and the later is definitely doing remote debugging according to my firewall; PyScripter doesn’t have this issue when using its internal engine either).
  2. External run output window – one way around #1 is to use the “External Run” command rather then “Run” command, however this window does not allow cutting of anything other then the entire output and it lists file paths in the obfuscated short name form rather then the long name form. Due to the in ability to copy specified output I find myself ATL+TABing to a command prompt to do runs.
  3. Find & Replace – if you select the block of text you want to limit a find and replace to and initiate F&R when you start typing in the find box the selection is moved to the first occurance of the text to find, so its necessary to put the word in first (it’s a toolbar not a dialog) and then select the text block and then got back up and high the replace button. UPDATE: see Find & Replace section below for details.
  4. Non-standard key bindings – while this is a Win32 only app it does not use standard Win32 key bindings. For example undo is CTRL+SHFT+Z not CTRL+Y. Goto line is ALT+G not CTRL+G. Save all isn’t bound to anything and CTRL+SHFT+S was bound to some command I wasn’t clear on the function of. These are hardly deal killers as key bindings can be manually rebound and exported (and then imported into a different install), but its an annoyance none the less.
  5. Hangs Resulting in Data Loss – when ALT+TABing between a command prompt (due to combination of annoyance #s 1 and 2) PyScripter sometimes hangs. This possibly only happens when Media Player is running (or just running in the foreground) and “Show code hints” is enabled as it is by default (see #6). This also compounded #4 as the key bindings apparently don’t get persisted until the IDE is closed so at one point I got a nasty surprise when I hit CTRL+Y as it deleted lines rather then redoing and then of course that part of the redo buffer was gone. UPDATE: I also found that when hitting the escape key to clear a window it occasionally issues an error message and then hangs after the error dialog is cleared. I think there was typically a code completion window (this occasionally shows up empty and partially off the screen to the left side, so I’m not positive) up that I was trying to get out of the way when this occurred so I ended up turning this off after I lost work for the second time. Perhaps the code completion window uses code similar to the reference defition custom tooltip mentioned in #6.
  6. Reference definition custom tooltip – when ATL+TABing between PyScripter and any other app PyScripter will sometime jump back to foreground. This seems to be caused by the reference definition custom tooltip being displayed and sometimes this tooltip window will stay on top over the app that was ATL+TABed to (I’ve got one sitting over FireFox right now as I type this). Also this custom tooltip has no time out and it blocks the view of the two lines of code after the reference, so I find my self frequently moving the mouse pointer to get rid of it so I can actually read my code. I did locate a toggle in the options for “Show code hints” that disabled this custom tooltip. This in turn required binding a key (F12 as in VC6) to “Find Definition” as while that tooltip has a link to the definition on it and there is no Find Definition option on the right click menu. UPDATE per comment by PyScripter, CTRL+LEFT CLICK executes Find Definition.

Duplicating Code

Of the 6, #3 is looking like the one that will make Wingware’s Python IDE (aka Wing IDE) worth the purchase. I tend to duplicate and tweak code frequently as I’m coding. While I don’t generally retain the duplicated code (with the notable exception being unit tests for which I don’t always bother to pull it out in to functions) it’s a great way to discover the exact patterns in code rather then trying to anticipate the pattern and get it wrong enough to have to refactor more then once. Sure if you can anticipate the pattern exactly correctly no refactoring is required but at other times it takes multiple passes and it would have been quicker to duplicate code, find the exact pattern, and then refactor once.

Find & Replace

Anyway, I find any annoyances in Find & Replace to hamper my productivity enough to make it worth spending some cash to get rid of them. I think it was during the development of Whidbey (VS8.0; Visual Studio 2005; although it could have been the previous version) that the editor team decided to party on the Find & Replace dialog in VS and in the process numerous regressions were introduced impairing it’s efficient use. At that time people working on VS generally did not use VS to write code (lots used Source Insight) for a number of very valid reasons, so these issues were not getting raised. I don’t recall what I was doing that I noticed the issues since I was using Source Insight as a code editor myself, but I ran into them, opened bugs, and then had to push back after a number of them were closed as being by (bad) design. There really aren’t that many good models for how Find & Replace should work, so I don’t really understand why folks see the need to try to reinvent the wheel here rather just fully implementing a well established F&R model.

UPDATE: I’ve discovered that toogling off “Incremental Search” find option stops the behavior were the block selection is lost when typing in the text to be found and replaced, but I can find no way to have “Search in Selection” automatically toggled on if I hit control H with a block of text selected as it will be with every other code editor I’ve used.

Commercial Python IDEs

It’s to bad that ActiveState decided to discontinue their Visual Python plug-in for VS. That would have been a no-brainer for which IDE to use for Python development. ActiveState’s Komodo IDE is not a no brainer as it costs $295 for a license vs $179 for single platform license for Wing IDE. A two platform Wing license is $295 and a three platform is $395, so Komodo IDE is the same or cheaper if one needs to develop on more then one platform, and if one needs to develop Perl, PHP, Tcl, or Ruby as well as Python Komodo supports all of those were as Wing IDE is just Python. At present all I’m interested in Python on Win32, and Wing IDE’s Python support is better then Komodo’s from what I could gather from using both evaluation versions. I didn’t use Komodo very long though. I just tried a few things to see how it compared to the broad field of Python IDEs and editors I started out comparing. Guess I better take a second look at Komodo before shelling out for an IDE though.

This entry was posted in Coding and tagged , , , , . Bookmark the permalink.

6 Responses to PyScripter annoyances and general find & replace gripes

  1. Pingback: Komodo Edit vs Komodo IDE vs WingIDE vs PyScripter « Josh Heitzman’s Impersonal Blog

  2. PyScripter says:

    A quick response to your comments:
    1,2. Use the remote interpreter/debugger ( You can then reinitialize the remote engine (Ctrl+F2) even while your script is running.
    3. You must be having the incremental search option on. Works as expected if this option is turned off.
    4. These are the shortcuts of Borland IDEs. Please submit additional presets or highlighter schemes that will be added to
    5,6 You are probably missing one of the coolest features of PyScripter. If you Ctrl+Click on an identifier it jumps to its definition. This works with the browse forward/backward buttons in the editor toolbar, which allows you to navigate through the code in a very handy way.

  3. Thanks for the reply PyScripter. Regarding #3, per the UPDATE sub-section of the Find & Replace section, I did discover turning off incremental search resolved the issue specified by #3; however, it does not solve the issue of the IDE not automatically turning on “Search in Selection” if a block of text is selected (and then turning it off after the replacement has been made).

  4. charles says:

    dude, the ctrl+y thing killed me. tried to redo, and instead accidentally deleted lines of my code.

  5. charles says:

    also, cannot figure out how to unset it in the tools -> options. i set it to redo, and it still decides to delete my line instead.

  6. Anonymous says:

    @charles, you need to set Ctrl+Y in IDE Shorcuts->Edit->actEditRedo in addition to *removing* Ctrl+Y in Editor Options->Keystrokes.

Have something to say?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s