[IronPython] Problem with time module in IronPython 2.0

Michael Foord fuzzyman at voidspace.org.uk
Sat Jan 31 20:35:29 CET 2009


António Piteira wrote:
> Hello Michael,
>
> Thank you for your reply.
>
> I've done sys.path.append("c:\CPython26\lib")... shouldn't this work?
>   

I think you have solved your problem now - but for IronPython 2 you 
should be using the standard library for Python 2.5 and *not* the 2.6 
one, and if you have strings with backslashes in them you must make them 
raw strings or use double backslashes.

All the best,

Michael
> ----------------------------------------------------------------------------
> ----------------------
>
> Hello Antonio,
>
> I've used the time module fine from IronPython 2 (you can confirm this 
> by installing IP 2 from the msi installer). I suspect you have not 
> correctly set sys.path for your hosted code. Print sys.path from inside 
> the hosted environment and confirm that the directory containing the 
> time module is there.
>
> All the best,
>
> Michael Foord
>
> António Piteira wrote:
>   
>> *http://www.wtvision.com/Mail/2007/logo_wTVision.gif* 
>> <http://www.wtvision.com/>**
>>
>> 	
>> 	
>>
>> *www.wtvision.com <http://www.wtvision.com>**
>> Tel: +351 21 831 06 86
>> Fax: +351 21 831 06 81
>> email: **info at wtvision.com <mailto:info at wtvision.com>***
>>
>> 	
>>
>> *Estúdios Grupo TV 
>>
>>     
> <http://maps.google.com/maps?f=d&hl=en&geocode=2727134586203630395,38.937584
> ,-9.230719&saddr=Unknown+road+%4038.937584,+-9.230719&daddr=&mra=mr&sll=38.9
> 35778,-9.226456&sspn=0.033849,0.080338&ie=UTF8&ll=38.935778,-9.226456&spn=0.
> 033849,0.080338&t=h&z=14>
>
>   
>> Travessa da Fonte de Cima, nº 2
>> Asseiceira Grande
>> 2665 **–618 Venda do Pinheiro** *
>>
>> * *
>>
>> * *
>>
>> * *
>>
>> 	
>>
>> Hi,
>>
>> In Ironpython 1.x I could easily import time and do stuff like 
>> time.sleep(x), but since I’ve changed to IronPython 2.0 I’m unable to 
>> do this. I always get “No module named time”.
>>
>> I have IronPython hosted in an application and I’ve already tried to 
>> append python libs path too.
>>
>> Any ideas?!
>>
>> * *
>>
>> * *
>>
>>
>> 	
>>
>> **
>>
>>
>> * *
>>
>>
>> 	
>>
>> *António Piteira**
>> Project Development
>> Director
>> email: antonio.piteira at wtvision.com <mailto:antonio.piteira at wtvision.com>
>> mobile: +351 93 449 19 74 *
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>   
>>     
>
>
>   


-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list