I use Drush php-eval quite some time. It's part of a quick evaluation process, to see if your function is working, find everything it needs and preferably provides you the perfect result. But I don't like entering php code in the terminal.
You have a similar thing provided by Devel module. You can evaluate on a page callback in a textarea. But ehm doesn't feel ok. Only advantage is that you can use convenient line breaks. Probably there is a library that adds syntax highlight to textareas - or something. Not sure you can do that actually. Maybe that has to be an iframe using document.designmode = 'on' directive on it.
I was thinking on a native cocoa app, but I'm looking for an easier solution. So I turned to Python. After a little search it seemed that the WX library is one of the best way to make UIs. (However it's surprising how many GUI libraries are there.) I quickly installed the library and created a simple project:
import wx from subprocess import call class MyApp(wx.App): def OnInit(self): frame = wx.Frame(None, -1, "Drush proxy") id = wx.NewId() self.textCtrl = wx.TextCtrl(frame, id) id = wx.NewId() self.button = wx.Button(frame, id, "Run") self.Bind(wx.EVT_BUTTON, self.onClick) frame.Show(True) self.SetTopWindow(frame) return True def onClick(self, event): call(['drush', '-r ~/WEBROOT', 'php-eval', '"' + self.textCtrl.GetValue() + '"']) app = MyApp(0) app.MainLoop()
It's not ready - just saying. I'm using the subprocess library to reach the shell layer but for some reason when calling Drush it returns with some strange JSON objects. Native commands seems to work fine.
My guess is that IO streams are not functioning the same way when you originate your process from Python - maybe I'm wrong. That's a little homework for me.