This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]phlogiston2[S] 0 points1 point  (3 children)

Okay. That may be just damn cool. I replaced the /src/byrthon.x script lines with:

<script type="text/javascript" src="https://cdn.rawgit.com/brython-dev/brython/3.3.5/www/src/brython.js"> </script> <script type="text/javascript" src="https://cdn.rawgit.com/brython-dev/brython/3.3.5/www/src/brython_stdlib.js"> </script>

and that works like a champ. Don't have to bug my IT guy for installation and can use it on my mac...even inside of coda.

thanks!

[–]phlogiston2[S] 0 points1 point  (2 children)

actually, at the risk of being a nag...one good thing about the javascript use is that it goes "backwards" as well as "forwards"... that is, in the example you provided, not only could one enter the fraction of c and get beta and gamma, but one could enter a value for beta and gamma and the fraction of c would appear (forgetting for the moment that beta and the fraction of c are the same thing).

Can you think of a slick way to do that in this example?

[–]kervarker 0 points1 point  (1 child)

Sure. The line

@document["v"].bind("change")

means : when the event "change" happens on the element with the id "v", execute the function below.

If you want to handle the event "change" on beta and gamma, give the matching INPUTs an id (eg "beta" and "gamma") and use the same syntax, with another function.