Share

Jeepers

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Stop shelling and start importing

You are viewing a single message from this topic. View all messages.

  1. 2001-12-12 21:14:09 UTC
    I am now using:

    #
    sExtraCode='other_code12.py'
    execfile(sExtraCode,globals())
    TestCommand = CommandCode()
    TestCommand.doCommand(sRunCommandArgs)
    TestCommand = None
    #

    Where other_code12.py contains class CommandCode with method doCommand. Each time the code is run the object TestCommand is redefined and runs the code in file that is in the string sExtraCode. Every time the code is run in the project sExtraCode can contain different paths to python modules. I am using this method to make the python modules act as plug-in files. Just write a python module and drop it in the bin folder and it starts acting as an extension of the project.

    So I guess execfile method was just what I needed.
< Previous | 1 | Next >

Add a Reply

You can use Markdown syntax in your reply.

Preview

Monitor this

Log in to monitor this topic. Not registered? Create an account to receive email updates when replies are posted to this topic. If you do not log in or register, your reply will be added anonymously.