亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to do hot update in Pyd?
僅有的幸福
僅有的幸福 2017-06-13 09:24:40
0
3
1482

Now we have a plug-in update system for the PC client. In the past, the plug-in had the suffix .py. no problem. But recently there is a problem when using cython to compile pyd. When the main program imports the pyd module, it cannot be deleted. Prompt file occupation. It can only be deleted when the main program is closed. But this loses the meaning of hot update. Is there any way to dynamically uninstall pyd or is there a better way?

import xxpyd
import sys

print 'xxpyd' in sys.modules
del sys.modules['xxpyd']
print 'xxpyd' in sys.modules

import time
time.sleep(100)

Even if sys.modules is deleted, pyd cannot be deleted.

僅有的幸福
僅有的幸福

reply all(3)
Ty80

There is currently a compromise solution, which is to use a plug-in management class to control the import and acquisition of pyd. The advantage is that it can be hot updated as many times as desired. The disadvantage is that all referenced import syntax must be replaced by the plug-in management class to import

劉奇

If the imported pyd file cannot be deleted, can it be updated with a new pyd file every time, such as 20170616.pyd (just an example). Other old files will be deleted every time the main program is stopped or at other times.

給我你的懷抱

pyd is essentially dll

There is a saying called dll hell, which describes how difficult it is to do version management of dlls

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template