[GRASS-dev] GSoC 2018 report week 04 - GRASS GIS module for Sentinel-2 cloud and shadow detection

Vaclav Petras wenzeslaus at gmail.com
Mon Jun 11 09:04:25 PDT 2018


On Mon, Jun 11, 2018 at 11:13 AM, Roberta Fagandini <robifagandini at gmail.com
> wrote:

>
>
> 2018-06-11 10:29 GMT+02:00 Moritz Lennert <mlennert at club.worldonline.be>:
>
>
>>
>>         - The code for reading this file can probably be simplified
>>           quite easily by using something like this:
>>
>>         for line in file(input_file):
>>                 a = line.split('=')
>>                 if len(a) <> 2 or a[0] not in ['blue', 'red', etc ]:
>>                         gscript.fatal("Syntax error in the txt file.")
>>                 a[1] = a[1].strip()
>>                 bands[a[0]] = a[1]
>>
>
> Thank you! this is a better solution than mine. It was a first experiment
> but I have already implemented your suggestion.
>


Please note that: In Python 2 "The forms <> and != are equivalent; for
consistency with C, != is preferred; where != is mentioned below <> is also
accepted. The <> spelling is considered obsolescent." In Python 3, there is
no <>, only !=.

https://docs.python.org/2.7/reference/expressions.html#comparisons
https://docs.python.org/3/reference/expressions.html#comparisons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180611/2f796f7f/attachment.html>


More information about the grass-dev mailing list