python爬silverlight_如何在IronPython / Silverlight中導入鈎子?

I'm extending TryPython to (along with various other things) allow users to save a file and subsequently import that file. TryPython overloads the built in file operations, so I need to know what parts of import need to hooked into in order for import to use the overloaded file operations.

我正在擴展TryPython(以及其他各種事物),允許用戶保存文件並隨后導入該文件。 TryPython重載內置文件操作,因此我需要知道導入的哪些部分需要掛鈎才能導入以使用重載文件操作。

Really, a basic overview of IronPython's import when used in Silverlight would be extremely helpful. I don't need a complete working solution (although I won't stop you from writing one! :). I'm a Python newbie, and I really have no idea where to even begin.

實際上,在Silverlight中使用IronPython導入的基本概述非常有用。我不需要一個完整的工作解決方案(雖然我不會阻止你寫一個!:)。我是一個Python新手,我真的不知道從哪里開始。

Thanks!

謝謝!

1 个解决方案

#1

2

IronPython's import basically works as usual but the file system is abstracted away in Silverlight. This is done by the DLR hosting API's PlatformAdaptionLayer. The end result is that all requests for files to be imported go to the XAP file rather than going to the file system.

IronPython的導入基本上和往常一樣,但文件系統在Silverlight中被抽象出來。這是由DLR托管API的PlatformAdaptionLayer完成的。最終結果是所有要導入的文件請求都轉到XAP文件而不是轉到文件系統。

I would suggest using one of the various ways you can replace importing functionality. You could either redefine import or better yet use the importer hooks

我建議使用各種方法中的一種來替換導入功能。您可以重新定義導入或更好地使用導入程序掛鈎

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值