import MY_DLL G_Logfile = None def TestFunction(): G_Logfile = open('Pytestfile.txt', 'w') G_Logfile.write("%s \n"%'I am writing python created text file') G_Logfile.close G_Logfile = None #end def TestFunction if __name__ == "__main__": MY_DLL.RECEIVE_FROM_IL_S(10,50)