[IronPython] import __main__ (ImportError:)

Hector Miuler Malpica Gallegos miuler at gmail.com
Sat Jan 21 00:17:27 CET 2006


Hello friends, proving the compatibility of python with IronPython I have
these errors, will be corrected in a future?

====================================================
$ ipython

In [1]: class miuler:
   ...:     def __init__(self):
   ...:         print self
   ...:         print type(self)
   ...:

In [2]: jojo = miuler()
<__main__.miuler instance at 0xb7b2b4ec>
<type 'instance'>

In [3]:
====================================================



====================================================
$ IronPythonConsole.exe
IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
>>> class miuler:
...     def __init__(self):
...        print self
...         print type(self)
Traceback (most recent call last):
SyntaxError: invalid syntax at <stdin>:3
>>> class miuler:
...    def __init__(self):
...        print self
...        print type(self)
...
>>> jojo = miuler()
<__main__.miuler instance at 0x000000000000002B>
Traceback (most recent call last):
  File , line 0, in __init__
Exception: Object reference not set to an instance of an object
>>>
====================================================



2006/1/16, Hector Miuler Malpica Gallegos <miuler at gmail.com>:
>
> Hello friends, I have problems when trying to execute script I throw in
> python:
>
> miuler at miuler:/usr/lib/python2.4$ python
> Python 2.4.2 (#2, Nov 20 2005, 17:04:48)
> [GCC 4.0.3 20051111 (prerelease) (Debian 4.0.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> __name__
> '__main__'
> >>> import __main__
> >>> type (__main__)
> <type 'module'>
> >>>
>
>
> miuler at miuler:~$ IronPythonConsole.exe
> IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42
> Copyright (c) Microsoft Corporation. All rights reserved.
> >>> __name__
> '__main__'
> >>> import __main__
> Traceback (most recent call last):
> ImportError: No module named __main__
> >>> __name__
> '__main__'
> >>> type (__main__)
> Traceback (most recent call last):
> NameError: name '__main__' is not defined
> >>>
>
>
> PS IPython also has east error.




--
     _\|/_
     (O-O)
--oOO-(_)-OOo----------------------------------------
Hector Miuler Malpica Gallegos
Universidad Nacional del Callao - Peru
Escuela de Ingenieria Electronica

usuario registrado #308608
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060120/4e692993/attachment.html>


More information about the Ironpython-users mailing list