Saturday, February 11, 2006

Lightning compiler: drag and drop option

A new version (1.5) of Lightning Compiler has been released. It is now possible to "drag" a file (icon) and "drop" it in the editor window. The text of the file will be automatically imported to the editor window. This option has been added following a suggestion. Since I believe that it fitted well with the philosophy of L.C. as a quick-and-painless testing tool for Python scripts, I decided to implement it (which was surprisingly easy, thanks to wxPython!)

Feel free to suggest other useful options. :-)


Tim Golden said...

The CheeseShop entry looks a bit bare. Did you do " register" and then leave it there? Because my experience is that you need to fill things in a bit more.

André said...

Thank you Tim. It was a bit bare indeed. It was perhaps a bit too much like the CheeseShop skit of Monty Python!

Anonymous said...

Thanks for a great little app!

I agree with your design goals, and please keep it lightweight and one file. Here are my small wishes:

1) I actually prefereed the side-by-side view you had first. Would it be possible to provide a constant (setting) in the file that can be easily modified by user? As a widescreen user I have more free space sideways.

2) In fact, moving such things as initial screen size and other view/handling settings up as constants in the beginning of the file would simplify any "personalisation" without having to understand the code.

3) I changed the "faces" to suit my font preferences, but this only works for editor. If I change the font, it is because that is how I prefer to view all my Python code. Could you make that font the default for interactive shell as well?

4) Could you have a "Run As" button or something that allows simple input of runtime arguments? Remember the last arguments entered in that session so I don't have to enter it for a re-run.

André said...

If these are small wishes, I'd hate to see what big ones would be! ;-)

These are good suggestions, and I will try to implement them all. The only potential problem I see is with the fourth one. Since the code is run via the "exec" command, it does not have access to the environment (via import sys, etc...). I have an idea as to how to "fake it" but it will likely require modifying the user code (perhaps just a single line) to make it work.

As usual, I'll make a post to this blog when I get the changes done.

ratih said...

I'm new with Python programming, can u help me to describe the step to implement drag and drop in python and also what tools that I need to implement it. thx for ur help

André said...


I used wxPython as a GUI library. wxPython has support for drag and drop applications. wxPython has a comprehensive set of examples/demos which would answer your questions. However, if you are new to Python programming, you may find that learning to use a library like wxPython can be difficult. I have not used it for over a year myself and can't really help anyone with it.

ratih said...

thx for ur answer Andre