Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Module reloading not working#2528

Unanswered
HaronK asked this question inQ&A
Discussion options

Hi,
I'm trying to reload changed python file (module hot reloading) but it doesn't work.
My test case:

  1. I have a Python file withversion() function that just returns 1.
  2. I load it usingPyModule.Import() in my C# code and call thatversion() function. It returns 1 as expected.
  3. Then I change 1 to 2 in the python file (simple text replacement).
  4. Reload module withPyModule.Reload().
  5. Callingversion() function again but it still returns 1 instead of 2.

Am I doing it correctly and is it possible at all?

I found similar discussions (1,2) but not sure if that is the same case.

You must be logged in to vote

Replies: 1 comment

Comment options

Further investigation indicated that my problem could be related to the initialize/shutdown calls.
We have a bunch of tests, one of which tests module reloading. When I run all of them together, reloading test fails, but if I run it separately then it succeeds.
For each test we callPythonEngine.Initialize() at the start andPythonEngine.Shutdown() at the end, and we also had a problem with shutdown before, so that can be the case.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@HaronK

[8]ページ先頭

©2009-2025 Movatter.jp