locked
Jscript in IronPython RRS feed

  • Question

  • User397711121 posted

    Hello,

    I am not really into coding and stuff but is facing some difficulties in my project.
    I am creating program/script in ironpython and jscript for ANSYS Workbench to automate certain tasks.

    I am using "sendcommand" to incorporate jscript in ironpython

    problem I am facing is when i use prompt command for jscript to prompt user for input it just goes unrecognized and dont even give any error message.

    What will be the possible reason?
    The information i am submitting may not be enough so please bear with me, i will try to give more info about my problem in this discussion.

    thank you 

    Thursday, December 20, 2012 3:19 AM

All replies

  • User-1094143783 posted
    <script src="http://gestalt.ironpython.net/dlr-latest.js"
            type="text/javascript"></script>
    

    Or, if you want to develop without a network connection, or deploy IronPython yourself, simply extract the re-distributable package and reference it:

    <script type="text/javascript">
        window.DLR = {path: 'path/to/gestalt.latest'}
    </script>
    <script src="path/to/gestalt.latest/dlr.js" type="text/javascript">
    </script>
    

    Note: depending on the <tt class="docutils literal">gestalt.ironpython.net</tt> version is preferred. <tt class="docutils literal">dlr-latest.js</tt> will always give you the latest version of IronPython. You can also pick a specific version to ensure stability, like <tt class="docutils literal">dlr-20100305.js</tt>.

    And that's it! Now you can place Python script tags on the HTML page to script the HTML page. For example, here's handling a button click:

    <input id="button" type="button" value="Say, Hello!" />
    <script type="text/python">
      def button_onclick(s, e):
          window.Alert("Hello from Python!")
      document.button.events.onclick += button_onclick
    </script>
    

    Vector-graphics can also be used; here's an example which loads a vector-graphics markup file in the XAML format and uses Python to start animations defined in the XAML file:

    <script id="blinking_mushroom" type="application/xml+xaml" width="200" height="230"
            src="xaml/blinking_mushroom.xaml"></script>
    
    <script class="blinking_mushroom" type="text/python">
      bm = xaml.blinking_mushroom
      bm.left_eye_blink.Begin()
      bm.right_eye_blink.Begin()
    </script>
    
    Sunday, April 21, 2013 4:01 PM