[IronPython] How to convert between C# and IronPython

Jimmy Cao jcao219 at gmail.com
Thu Aug 5 04:07:54 CEST 2010


For the first line, you can translate it to:

from System import Array, Byte

rndBytes = Array.CreateInstance(Byte, 10)



On Wed, Aug 4, 2010 at 6:02 PM, Andrew Evans <evans.d.andrew at gmail.com>wrote:

> Hello
>
> I am trying to follow a tutorial written for silverlight and C# and convert
> the code to Iron Python. However I am unsure about how to use this code as
> IronPython
>
>         Byte[] rndBytes = new Byte[10];
>
>
>         RNGCryptoServiceProvider rndC = new RNGCryptoServiceProvider();
>         rndC.GetBytes(rndBytes);
>         int seed = BitConverter.ToInt32(rndBytes, 0);
>         Random rand = new Random(seed);
>
>
>         return rand.Next(min, max);
>
> what modules do I need. How do I use Byte in IronPython etc
>
> Any ideas advice *cheers
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100804/0356e641/attachment.html>


More information about the Ironpython-users mailing list