<div dir="ltr">Oh! <div>Thanks "g" flag combined with .split() worked!!!! </div><div><br></div><div>Leo</div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-04-06 11:59 GMT+10:00 Anna Petrášová <span dir="ltr"><<a href="mailto:kratochanna@gmail.com" target="_blank">kratochanna@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Apr 5, 2016 at 9:15 PM, Leonardo Hardtke <<a href="mailto:leohardtke@gmail.com">leohardtke@gmail.com</a>> wrote:<br>
> Thanks Laurent for your help,<br>
> it worked to split the string to a list....but now I have to remove the 1<br>
> line(group <LE72270902002150EDC00_toar> references the following raster<br>
> maps), line 2 ('-------------'), the last line ('-------------') and the<br>
> "<>" around the names...<br>
> I know how to do that.... but is this the best way to deal with outputs of<br>
> i.group -l in python?<br>
><br>
><br>
><br>
<br>
<br>
</span>You should use i.group -g (Print in shell script style)<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Anna<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
> 2016-04-06 11:02 GMT+10:00 Laurent C. <<a href="mailto:lrntct@gmail.com">lrntct@gmail.com</a>>:<br>
>><br>
>> Hello,<br>
>><br>
>> Try the .splitlines() method on the string.<br>
>><br>
>> Cheers,<br>
>> Laurent<br>
>><br>
>> El abr. 5, 2016 19:52, "Leonardo Hardtke" <<a href="mailto:leohardtke@gmail.com">leohardtke@gmail.com</a>> escribió:<br>
>>><br>
>>> Dear list members,<br>
>>> I know this is more a python question than a GRASS question, bot for sure<br>
>>> some of you knows the ansewer and is able to help me....<br>
>>><br>
>>> I need to get a python list with the maps from a group, like<br>
>>> ["map1","map2","map"]<br>
>>><br>
>>> But by using gscript.read_command.... i get string, not a list.<br>
>>><br>
>>> gscript.read_command("i.group", group=groupname, flags="l" )<br>
>>> 'group <LE72270902002150EDC00_toar> references the following raster<br>
>>> maps\n-------------\n<LE72270902002150EDC00_toar.1@landsat><br>
>>> \n<LE72270902002150EDC00_toar.2@landsat><br>
>>> \n<LE72270902002150EDC00_toar.3@landsat><br>
>>> \n<LE72270902002150EDC00_toar.4@landsat><br>
>>> \n<LE72270902002150EDC00_toar.5@landsat><br>
>>> \n<LE72270902002150EDC00_toar.7@landsat>    \n-------------\n'<br>
>>><br>
>>> Your help is appreciated!<br>
>>> Leo<br>
>>> --<br>
>>> Dr. Leonardo A. Hardtke<br>
>>> Laboratorio de Teledetección y S.I.G.<br>
>>> Centro Nacional Patagónico (CONICET)<br>
>>> Bvd. Brown 2825, 9120<br>
>>> Puerto Madryn, Chubut, Argentina<br>
>>><br>
>>> _______________________________________________<br>
>>> grass-user mailing list<br>
>>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Dr. Leonardo A. Hardtke<br>
> Laboratorio de Teledetección y S.I.G.<br>
> Centro Nacional Patagónico (CONICET)<br>
> Bvd. Brown 2825, 9120<br>
> Puerto Madryn, Chubut, Argentina<br>
><br>
> _______________________________________________<br>
> grass-user mailing list<br>
> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Dr. Leonardo A. Hardtke   <br>Laboratorio de Teledetección y S.I.G.  <br>Centro Nacional Patagónico (CONICET) <br>Bvd. Brown 2825, 9120 <br>Puerto Madryn, Chubut, Argentina </div></div>
</div>