|
From: Curtis R. <ctr...@wi...> - 2017-03-14 19:00:38
|
Hi Fernando,
> I have a friend who's coming from a Python background, and would like
> to dabble in Jython. Are there any samples online for instance for
> generating a simple Jython JAR that calls datepicker API to select a
> certain date, then does something with that?
The SciJava Jython script language plugin [1] supports a special parameter
syntax, which lets you specify inputs of various types, including dates
(harvested under the hood using JDatePicker).
Here is a sample script:
# @Date date
print("You chose: " + str(date))
But that is not exactly vanilla Jython.
I looked at calling JDatePicker directly, but it is a little involved since
you have to set up your Swing components and such. Probably not the
friendliest intro to Jython for your friend. Does it have to be date
picking specifically?
Regards,
Curtis
--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
[1] https://github.com/scijava/scripting-jython
On Wed, Mar 8, 2017 at 8:11 PM, Fernando Cassia <fc...@gm...> wrote:
> Hi there,
>
> I have a friend who's coming from a Python background, and would like
> to dabble in Jython.
> Are there any samples online for instance for generating a simple
> Jython JAR that calls datepicker API to select a certain date, then
> does something with that?
>
> My intention is to encourage him to get into jython rather than to
> scary him, to the simpler the sample code is, the better...
>
> For instance I told him to get Netbeans and the Jython plug-in,
> although I'm not sure if the one on the Netbeans Plugins page works
> well with 2.7x
>
> Thoughts? Comments? Thanks...
> FC
>
> ------------------------------------------------------------
> ------------------
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford
> _______________________________________________
> Jython-users mailing list
> Jyt...@li...
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
|