[IronPython] How to find import in ipy

Michael Foord michael at voidspace.org.uk
Thu Mar 11 18:36:54 CET 2010

On 11/03/2010 17:33, Ken MacDonald wrote:
> Thanks Michael,
> We're using .NET, so this should be OK, I guess? 

If you're using IronPython that you are definitely using .NET. Do you 
mean you are using ASP.NET?

> All of the other controls (StackPanel, Grid...) are being imported 
> from System.Windows.Controls, so I thought ListItem ought to have been 
> somewhere in there.
>>     from System.Web.UI.WebControls import ListItem
>     That's for ASP - is that what you are using?
>>     but I get "can't import UI"
>     You will need to add a reference to its containing assembly before
>     you can import it.
> What is the 'containing assembly'? Should I do something like....

If you go to the MSDN page you were using as a reference previously it 
will tell you what *assembly* the WebControls namespace is contained in 
(System.Web perhaps).

You will need to add a reference to this assembly before you can import 
from it. This will look *something* like:

     import clr

All the best,


> from System.Web import UI
> (guess, not, same error!)
>>     So, anyone know how to do this?
>>     Also, I'm concerned that next time (if I ever get it working
>>     first time) I come to this popup, it will contain the items I had
>>     added previously; how does one go about clearing the whole listbox?
>     listbox.Items.Clear()
>     HTH,
>     Michael
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100311/5a83a44d/attachment.html>

More information about the Ironpython-users mailing list