[gdal-dev] gdal-utils: understanding the __main__ pattern

2022-03-04 Thread Matt Wilkie
Hello folks who know about the python script construction :) The pattern used in all of the python scripts under swig/python/gdal-utils is foreign to me. Can someone explain what's going on and why it's used? (or point to where this has been explored already). if __name__ == '__main__': sys.e

Re: [gdal-dev] gdal-utils: understanding the __main__ pattern

2022-03-06 Thread Even Rouault
Matt, Le 04/03/2022 à 23:19, Matt Wilkie a écrit : Hello folks who know about the python script construction :) The pattern used in all of the python scripts under swig/python/gdal-utils is foreign to me. Can someone explain what's going on and why it's used? (or point to where this has been