Check out the video below or download 5KEdit for yourself.
- Fullscreen text editing
- Open/Save files
- Retro looks
- Resizable fonts
- Configurable colours
- Word count
- Goto line number dialog
- Find text dialog
- Help page listing commands
- About box
It’s actually a bit more feature-full than I’d thought it would be. Part of this was that wxPython’s wx.StyledTextCtrl and wxPython in general provided quite a lot of what I needed (e.g. undo/redo) out of the box. Plus the self-extracting script technique really did a good job of shrinking the code down – allowing me to add more.
To run 5KEdit your need Python (2.4+) and wxPython (2.8+) installed. If you are running OS X Leopard you already have those installed, so you can simple switch to a terminal and run that 5KEdit script using the command:
Make sure you run that from the directory
5KEdit.pyw is in. On a Windows system you may find that you can simply double-click on the
.pyw file to run it. There’s a small repaint bug under Windows when you change colors, but it’s not a show stopper.
Here are the vital statistics:
- 17284 bytes/485 lines of original source-code
- 13767 bytes/379 lines of stripped source-code
- 5069 bytes of compressed/packed final version
As you can see the final version is less than a third the size of the original source code. A large part of this is due to the compression, but to help push it a bit further the source was also “stripped”. Blank-lines and comments were removed and the indentation was changed from my usual 4 spaces to a single space. The stripping doesn’t make a huge contribution, but without it the final version would be 5421 bytes in size. So for 400 bytes or so it’s probably worth it. Plus it means that you don’t have to worry about leaving yourself comments or spacing out your code nicely.