run python script with an ini file
===

i'd like to run a python script with different ini files

I put some variable's in an ini.py and than i would like to run my program.py with this inifile.

I tried something like:

in batch-> program.py ini

    sys.argv[1]
    from sys.argv[1] import *

and

    eval('from '+sys.argv[1]+' import *')

but this doesn't work.

now I wrote:

    import sys
    f = open('outp.py','w')
    f.write("from "+sys.argv[1]+" import *\n")
    f.write("print x\n")
    with open('program.py', 'r') as content_file:
        content = content_file.read()
    f.write(content)
    f.close()
    
    execfile( "outp.py")

basicly rewriting my program file with an extra import statment....
there is an easier way i hope?! (not neccesarely in batch)
thx