<br>&gt;On Mon, May 31, 2010 at 5:39 AM, Daniel Lee <span dir="ltr">&lt;<a href="mailto:Lee.Daniel.1986@googlemail.com">Lee.Daniel.1986@googlemail.com</a>&gt;</span> wrote:<br>&gt;Hi Marcello,<br>&gt;<br>&gt;Great
that everything&#39;s working for you ;) I&#39;m also a beginner and loving
GRASS and Linux... Anyway, &#39;nuff said. To Python: Your script worked in
the new &gt;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>
&gt;I&#39;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 &gt;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">&gt;<br>
&gt;<b>&gt;python myscript.py raster1=map1 raster2=map2 output=outmap</b><br>&gt;<br></div>&gt;Following questions:<br>&gt;- Is it necessary to input &quot;python&quot; in front of the script name?<br><br>No, you can use ./ only.<br>
<br>&gt;- I was under the impression that Python scripts can be saved into the script directory (<b>/opt/grass/scripts</b>,
if I&#39;m not mistaken, right now I&#39;m on another &gt;computer so I can&#39;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>&gt;- 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&#39;t need to save it &gt;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>&gt;I&#39;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 &gt;and then fail to parse it correctly. Perhaps it was because I
was leaving off the &quot;python&quot; at the beginning of the command line;
everything else should be the &gt;same, the script was executable, etc. Any
other thoughts? I sadly can&#39;t give any examples at the moment because
I&#39;m on another computer and after my new &gt;nstallation I don&#39;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 &quot;python&quot; 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&#39;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>
&gt;Thanks!<br>&gt;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">&lt;<a href="mailto:gorini@gmail.com" target="_blank">gorini@gmail.com</a>&gt;</span><br>
<div><div><br>
<br></div></div>