Integrating ironpython into Silverlight to load server *. py files (resolved)

Source: Internet
Author: User

The problem is that we assume that we have put the LINQ. py and test. py files on the server.

Write in the test. py file

Import LINQ

Test. py will not find the LINQ. py file in the current directory, so the import of LINQ will fail,

Can I only download all *. py files to the client for execution at a time? Besides, it is still an absolute path to load *. py files in Silverlight,

Does anyone know?

-----

After two days of data collection, ironpython has basically solved the problem of integrating with Silverlight on the browser end,

First, there are two solutions to the py file loading problem, but it has not been verified:

1. Put the py file in the Silverlight masterProgramAnd set the file attribute to content. In this way, The py file will be packaged along with the xap file and loaded in by calling the usefile method of scriptscope in your CS.

 

2. Put the py file on the server, use WebClient or WCF to download the bytecode, convert it to a string or local file, and then use the Execute function of scriptruntime.

 

It seems that only the dlr sdk version 0.5 is available on the official website. I Can't compile the 1.0 source in any way, and it seems that the source or CLR is compiled under the C # assembly, there is a gap with the assembly of the Silverlight version I need.

 

In addition, the dlr sdk version downloaded on the ironpython website is too low, and there are problems with the implementation of many methods, even the most basic

Def sayhello (something ):

Return something + 'from python'

 

Will return: the failure to compare the two elements in the list is really frustrating. Fortunately, with the help of Boyou, I found a new SDK. It was really nice to use, and the two days of bad luck swept away, what makes us happy is the new call of PyCodeThe function does not need to be registered. It can be called directly using the dynamic type.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.