From: Rob A. <ro...@us...> - 2002-05-20 19:44:07
|
Easily-grasped examples are what Useless Python's all about. Of course, everyone is invited to contribute code, articles, tutorials, etc. to the site. Thanks again for providing filling in one of the many gaps of my ignorance this morning. I try to put things like that on Useless, because I figure that if I don't know it, someone else out there still doesn't know it. Rob http://uselesspython.com James Carroll wrote: >>http://uselesspython.com/Jython_Swing_Basics.html >> > > Nice Stuff Rob! Seldom are examples so palatable. > > my favorite similar page on the web is: > http://www.oreilly.com/catalog/jythoness/chapter/ch01.html > > and the less fun, but essential: > http://www.onlamp.com/lpt/a//python/2002/04/11/jythontips.html > > > I have a few little tricks that I'd like to contribute... like: > > import java > def copy(text): > c = java.awt.Toolkit.getDefaultToolkit().getSystemClipboard() > c.setContents(java.awt.datatransfer.StringSelection(text), None) > > > which lets you copy anything to the clipboard from Jython! > >>>>copy("this is now on the clipboard") >>>> > > I use this to generate GUIDs and other things I wouldn't want to type: > >>>>copy(mylib.makeGUID()) >>>> > > > Later, > -Jim > > |