Menu

#2 Requirement: Importing Scripts

1.0
open
nobody
2018-06-19
2018-06-19
k10blogger
No

Importing Scripts

The application shall allow scripts to be imported inside the running application and execute them. Scripts will always be external to the application. As it will be written by the end user of this application.

Solution 1

For developmental purpose. Started with a folder at the root directory named pyscripts. All the scripts that follows the scripting template are put into the folder and the main gui populates based on number of scripts that exists in the folder.
These are imported using the import module and reloaded using the reload function of the base python 2.7

Solution 2

Similar to solution 1. Only difference is the end user will be able to select the folder from where the application should read the script. Again this is handled by asking the user to configure the script path at the application startup which is then stored in an ini file.
Condition for this solution to work the folder should exists or the application needs to take in accound the absence and presence of folder and throw a warning of no folder or no scripts in the folder.

Solution 3

Any other alternatives yet to be explored.

Challenges

When packaged. The initial package seems to fail the scripts and execute them from the assigned folder. Investigation required.

Discussion


Log in to post a comment.