[GRASS-user] (no subject)

alassane toure atourej at gmail.com
Fri Aug 12 13:51:52 PDT 2016


Thanks Anna, it worked!

On Fri, Aug 12, 2016 at 11:31 AM, Anna Petrášová <kratochanna at gmail.com>
wrote:

> On Fri, Aug 12, 2016 at 1:05 PM, alassane toure <atourej at gmail.com> wrote:
> > Group,
> > I am running a grass-python script but when i replace a variable argument
> > within the command the script does not work....
> >
> > The following works...
> > grass.run_command('r.in.gdal',
> > input='/home/alassane/Data/SanbornCD/tile/newconstr_mask.tif',
> > output='construction')
> >
> > But not this...
> > command="'r.in.gdal', input='"+sys.argv[5]+"', output='construction'"
> > print 'r.in.gdal command argument... = %s\n ' % command
> > grass.run_command(command)
> >
> > print 'r.in.gdal command argument... = %s\n ' % command
> > r.in.gdal command argument... = 'r.in.gdal',
> > input='/home/alassane/Data/SanbornCD/tile/newconstr_mask.tif',
> > output='construction'
> >
> >
> > The following also works...
> > command ="/home/alassane/Programs/gdal/demclass1"+" "+infile1+"
> "+infile2+"
> > "+sys.argv[3]+" "+outfile
> > os.system(command)
> >
> > Your help is appreciated.
>
> Perhaps this?
>
> grass.run_command('r.in.gdal', input=sys.argv[5],  output='construction')
>
> Best,
> Anna
>
> >
> > Regards,
> > Alassane
> >
> > _______________________________________________
> > grass-user mailing list
> > grass-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20160812/9e5bf42b/attachment.html>


More information about the grass-user mailing list