Import a user Script from PythonLibraries: refresh problem

Moderator: Kathy_9

Post Reply
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Import a user Script from PythonLibraries: refresh problem

Post by ilgk48 »

Goog afternoon to all,
I'm using PSP 2019 for scanning and cleaning some old magazines.
I'm new to Python.
For my project I have just registered, modified and saved some Scripts.
Then I realized the necessity of a "repository.script" for registering some constants and functions "global" in the project (i.e. shared among the Scripts).
This my Repository.script is located in folder Python Libraries and is imported - when nedeed - by others Scripts.
Now the problem:
I've noted that if I modify the Repository.script while PSP is running, the changes do not apply and the Scripts maintain the old version.
In other word, it's seems that the Import command is acting only at the first call, but after there is no refresh.
Closing and restarting PSP makes all OK but, let me say, this is ... ehm ... annoying :D
Any suggestion?
Paolo
LeviFiction
Advisor
Posts: 6831
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8-2023
Location: USA

Re: Import a user Script from PythonLibraries: refresh probl

Post by LeviFiction »

I have not tested this myself. But, have you tried the reload() command?

Code: Select all

import module
reload(module)
Just reload it as soon as you import it.
https://levifiction.wordpress.com/
ilgk48
Posts: 63
Joined: Sun Apr 28, 2019 12:26 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
Corel programs: PaintShop PRO 2019 32bit

Re: Import a user Script from PythonLibraries: refresh probl

Post by ilgk48 »

Acc!
Reload() ... I've searched something like Refresh but not Reload :oops: .
I repeat: I'm new to Python.
Now I'm trying and ... it's WORK :)
Thank you very much.
Resolved.
Paolo
Post Reply