samedi 3 octobre 2015

Fetch conditions of IF-ELSE from Excel file in python

I have written a pyhton code which includes IF-ELSE statement. Inside the IF-ELSE statement, the conditions need to be fetched from an external file say Excel or Notepad. As the whole system is dynamic in nature, I can not manually change the conditions each time. So, I am planning to store the conditions/ rules in some external file and pass it as IF-ELSE condition. An example is given below:

Suppose, a.xlsx is the file containing three conditions/rules:

i>0 & k>9
j>0 & v<8
x>0

There might be more than three rules/ conditions i.e. dynamic. For now, just consider that there are 3 conditions.

If I need to pass these conditions to my python script, how to solve this problem?

Aucun commentaire:

Enregistrer un commentaire