[IronPython] [python] [IronPythonStudio] Namespace Classes and Assembly Files
Michael Foord
fuzzyman at voidspace.org.uk
Sat Jan 26 09:20:08 PST 2008
Pigneri, Rocco wrote:
> Dear all,
>
> I am new to Python, IronPython, and IronPythonStudio, but so far I am
> enjoying the functionality that IPS offers me.
>
> One thing that confuses me, however, is the namespace classes that IPS
> creates for me. Let's say I create a Windows Forms project called
> Forms with a default form called FormOne. FormOne is created in the
> Forms namespace while the Program.py file is placed in the Forms0
> namespace.
This is annoying (unpythonic) but is probably due to the way the CodeDom
works - it basically creates the equivalent IronPython to the C# it
would generate.
>
> I next add a new Form to the project by right-clicking on the project
> name in the Solution Explorer, and go to Add->New Item->Windows Form.
> I call this class FormTwo. FormTwo is now placed in the Forms
> namespace as well.
>
> If I try to use the FormTwo class in the Program.py file (i.e. I would
> rather start up with FormTwo rather than FormOne), Forms.FormTwo()
> does not do the trick. The debugger keeps reporting that the class is
> not found. This also happens if I add "from FormTwo import *" to the
> top of the file.
>
> What am I doing wrong here? I feel like I should be able to reference
> any class in an assembly/project from any class in the same
> assembly/project. I have been able to get this to work by changing
> the namespace class in FormTwo.py, but I feel like that is the wrong
> approach.
Can you post the actual error you get? The import and reference you
posted should work, so the exact error will tell us what is going wrong.
Michael Foord
http://www.manning.com/foord
>
> Thank you,
>
> Rocco
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
More information about the Users
mailing list