<br>>On Mon, May 31, 2010 at 5:39 AM, Daniel Lee <span dir="ltr"><<a href="mailto:Lee.Daniel.1986@googlemail.com">Lee.Daniel.1986@googlemail.com</a>></span> wrote:<br>>Hi Marcello,<br>><br>>Great
that everything's working for you ;) I'm also a beginner and loving
GRASS and Linux... Anyway, 'nuff said. To Python: Your script worked in
the new >version? That means in the new 6-4?<br>
<br>Hello Daniel, how are you?<br>Yes, I mean <span class="ul-threaded" style="margin: 0.5em 0pt 0pt -15px;"><span class="connect "><span id="li5120616" class="li-threaded"><span class="threaded"><span class="post-middle"><span id="post5120616" style="display: block;"><a href="https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4" target="_top" rel="nofollow" link="external">https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4</a> .</span></span></span></span></span></span><br>
>I've also tried running Python scripts and have had problems, I
ended up switching over to shell scripts because my work was very time
sensitive, but I really >like working with Python and I know it better
than shell scripting. I noticed in your post earlier that you used the
command:<div class="im">><br>
><b>>python myscript.py raster1=map1 raster2=map2 output=outmap</b><br>><br></div>>Following questions:<br>>- Is it necessary to input "python" in front of the script name?<br><br>No, you can use ./ only.<br>
<br>>- I was under the impression that Python scripts can be saved into the script directory (<b>/opt/grass/scripts</b>,
if I'm not mistaken, right now I'm on another >computer so I can't
check); is that necessary? If not, do you just enter the entire path to
the script?<br><br>Yes, you can also save it in the scripts directory and run it directly or you can enter the entire path in terminal and ./script.<br><br>>- I was also under the impression, that since you tell GRASS what kind of a script it is in the first line (<b>#!/usr/bin/env python</b>), that you don't need to save it >as .py. Am I mistaken there?<br>
<br>You are also right. I renamed it without the .py extension and it worked as well.<br><br>>I've
always saved my python scripts into the script directory and then tried
to run them from the GRASS wxPython GUI. It always seemed to find the
script >and then fail to parse it correctly. Perhaps it was because I
was leaving off the "python" at the beginning of the command line;
everything else should be the >same, the script was executable, etc. Any
other thoughts? I sadly can't give any examples at the moment because
I'm on another computer and after my new >nstallation I don't have the
failed script outputs as examples any more.<br>
<br>I saved it as r.myscript in the script directory and was able to run directly from the gui or the terminal with no problems. So I guess it is not because of the "python" in the command line. If your version is the same as mine now, I would check the code itself. But I am really a beginner in everything so I wouldn't listen to me very much.<br>
At least, I think I showed you that you are right in everything. If you can post some examples of your failed scripts later on, I (and everybody else) could try them for you. It would be good for my learning as well.<br><br>
>Thanks!<br>>Daniel<br><br>No, I thank you, since you are the first person I might be helping a little little bit in this list. It is good to at least try to contribute.<br><br>Best regards,<br><br>Marcello.<br><br>
2010/5/31 Marcello Gorini <span dir="ltr"><<a href="mailto:gorini@gmail.com" target="_blank">gorini@gmail.com</a>></span><br>
<div><div><br>
<br></div></div>