[IronPython] newbie getting started problem

Peter Howard peterhoward42 at gmail.com
Tue Aug 10 15:13:03 CEST 2010


Hi I've been following the getting started examples here:
http://blog.jimmy.schementi.com/2010/03/pycon-2010-python-in-browser.html

I've hit a newbie ignorance problem as soon as I've tried to go 'off-piste'
with this (below):

(The debug print statement shows up in the repl console and there are no
exceptions - but no gui shows up)

(In previous Python/Qt contexts I would have been concerned about my script
variables going out of scope at the end of the run and GUI artefacts being
garbage collected - but the examples I'm copying from don't seem to need any
special treatment to avoid garbage collection?).

Any help much appreciated - and by the way - after over 20 years as a
professional programmer - this is about the most exciting technology
combination I've come across.

Pete

html entry point:
-----------------------

<html>
  <head>
    <script src="http://gestalt.ironpython.net/dlr-latest.js"
            type="text/javascript"></script>
  </head>
  <body>
    <script type="text/python" src="repl.py"></script>
    <script type="text/python" src="app.py"></script>
  </body>
</html>

python source referenced as app.py:
----------------------------------------------------

from System.Windows import Application
from System.Windows.Controls import Canvas, TextBlock

canvas = Canvas()
textblock = TextBlock()
textblock.FontSize = 24
textblock.Text = 'This Really Works!!'
canvas.Children.Add(textblock)

Application.Current.RootVisual = canvas

print 'got to end'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100810/0488c897/attachment.html>


More information about the Ironpython-users mailing list