[IronPython] App.config file if there are more than one program instance

Michael Foord fuzzyman at voidspace.org.uk
Mon Jan 19 22:34:39 CET 2009


Caglar Toklu wrote:
> Hi to all,
>
> We are developing our product depending on another DLL acting as Database
> Layer. I have searched this forum and found the following posts:
>
> http://www.nabble.com/-IronPython--Application.config-td14159166.html#a14159166
> http://www.nabble.com/app.config-for-ipy-script--td20756955.html#a20756955
>
> They are both fine, and they suggest that placing an ipy.exe.config file
> next to ipy.exe. I have tried it and it worked fine. But, I have more than
> one application running on the same computer, and I need to have two
> different config files for them.
>
> So I have come up with the following solution [candidate] : Distributing an
> IronPython binary distribution [IronPython-2.0-Bin.zip] with each of them
> and calling the interpreter assigned to them. In this case, I can have two
> different (or as many as required) IronPython instances running in different
> directories with proper ipy.exe.config files. But, now I am stuck that
> IronPython could not find the modules such as ConfigParser and os. Is there
> a way to overcome this problem.
>
> Any help or ideas are appreciated, thank you in advance.
>
> Caglar Toklu
>
>   
Creating a custom executable that sets up sys.path and runs your script 
(using the IP hosting API) is basically trivial. That way you have your 
own exe to create the manifest for. (You could even use the Pyc compiler 
to do this.)

Alternatively your entry Python script could manually add to sys.path as 
the first thing it does - so that your imports work.

All the best,

Michael Foord

-- 
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog





More information about the Ironpython-users mailing list