In ASP.NET I'm guessing we don't ever make a module called __main__.  From the 
command line when you do "ipy foo.py" foo.py is actually called __main__ and 
there's no foo module.  But if you import foo from an interactive session then 
it's named foo.

You could do something like:

import sys
sys.modules['__main__'] = foo

where foo is whatever the "main" module is.  Or if this is your code you could 
change it to not try to import __main__ or make it try main and then try 
something else.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Pablo Dalmazzo
Sent: Thursday, August 12, 2010 7:58 AM
To: IronPython Mailing list
Subject: [IronPython] profiling in IronPython error

Hi guys,

Im trying to run this test I had in cPython in IronPython 2.6 in asp.net.

   from profile import *

    class Prueba(object):
        @staticmethod
        def probarvelocidad():
            lista = ['a','b','c']
            for x in lista: pass

    run("Prueba.probarvelocidad()","C:\melia")

It doesnt work, i get this

Mensaje de error del analizador: No module named __main__

Error de código fuente:  (Line 454, import __main__ )

Línea 452:

Línea 453:    def run(self, cmd):

  Línea 454:        import __main__


Any ideas? can I give any more useful information to know which the problem is?


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to