[SciPy-user] Automatic Indentation

Lorenzo Isella lorenzo.isella at gmail.com
Mon Mar 26 13:07:04 EDT 2007


Dear All,
Again a newbie question: I am postprocessing some data files with Python.
Let us say they are named {filea001...filea100},
{fileb001...fileb100}, {filec001...filec100} and so on.
I need to perform different operations on the three different data
sets, and I wrote a code for that.
The problem is that in the future the three data sets will not be
present simultaneously and I thought about simply defining a parameter
which assumes values {1,2,3} depending on which datasets are present
and using some if-conditions to tell the code which data it should
read and process, without changing dramatically the code structure.
Now, the problem is that I cannot simply encapsulate large parts of
the code into an if condition without also changing the indentation
and this is getting tedious and error prone.
I am sure I cannot be the first Python user to have come across this,
so I would like to know how more experienced users deal with this.
Kind Regards

Lorenzo Isella



More information about the SciPy-User mailing list