[GRASS-dev] grass.run_command() and Python keywords - was Re: [GRASS-user] i.maxlik
mlennert at club.worldonline.be
Mon Mar 4 02:55:37 PST 2013
On 03/03/13 11:36, Markus Neteler wrote:
> (switching to grass-dev due to a potential bugfix needed)
> On Wed, Feb 13, 2013 at 12:27 PM, Johannes Radinger
> <johannesradinger at gmail.com> wrote:
>> On Wed, Feb 13, 2013 at 10:36 AM, Rebecca Stedham
>> <rlstedham at btinternet.com> wrote:
>>> I am running i.maxlik in python - attempting to automate a processing chain.
>>> I use the command:
>>> grass.run_command('i.maxlik', group= group, subgroup=subgroup,
>>> class='classification', sigfile = sigfile, verbose = True)
>>> Infuriatingly, however 'class' is a python keyword and it doesn't run due to
>>> 'invalid syntax'.
>> I had a similar issue with v.distance which uses 'from', another python keyword.
>> Here the pythoncode is '_from' which looks like:
>> Maybe there is something similar for class ('_class'?) in i.maxlik.
> Here a solution was suggested:
> Not sure how to deal with that.
At the same link there is also a reference to the "official" GRASS solution:
which corresponds to Johannes' suggestion. Did this not work ?
More information about the grass-dev