[GRASS-user] How to embed a grass script (for example v.db.addcol) into a Pythonscript on windows?

Helmut Kudrnovsky hellik at web.de
Fri Apr 9 18:50:34 EDT 2010


sorry for the a html-mail twice ...

-----Ursprüngliche Nachricht-----
Von: Helmut Kudrnovsky <hellik at web.de>
Gesendet: 10.04.2010 00:43:47
An: Isaac Ullah <isaac.ullah at asu.edu>
Betreff: How to embed a grass script (for example v.db.addcol) into a Pythonscript on windows?

Hi Isaac,

sorry for my delayed answered, very busy in my normal job outside any gis.

what I've done (using the nightly builds of WinGrass7, http://josef.fsv.cvut.cz/wingrass/grass70/):

I've copied from http://grass.osgeo.org/wiki/GRASS_and_Python
all lines of code for the Display example in a text-file and saved this
in C:\Program Files\GRASS-70-SVN\scripts under for example test_h.py,
and this lines of code are working (python bundled by WinGrass7).

please open a ticket - if necessary - in trac (http://trac.osgeo.org/grass/) to keep
all important steps available for the community.

best regards
Helmut

---------------------
Von: Isaac Ullah
Gesendet: 06.04.2010 20:51:25
An: Michael Barton <Michael.Barton at asu.edu>
Betreff: Re: [GRASS-dev] Fwd: [GRASS-user] How to embed a grass script (for example v.db.addcol) into a Pythonscript on windows?

Hi all,

See the attached screen capture for the error I get when I try to run grass python scripts. This happens regardless of which version of python I use (ie. bundled python2.5, or using Glynn's .bat to start Grass with my version of python2.6), and occurs whether or not I add command line args to the script call. AFAICT when importing the "subprocess" methods, python seems to think it needs to also import some commands from "collections", which it fails to find. Any ideas about this?

Cheers,

Isaac


On Sat, Apr 3, 2010 at 1:20 PM, Michael Barton <[Michael.Barton at asu.edu]> wrote:

Thanks.

I'm sending this along to students. I didn't realize that there is a nightly build of GRASS 7 too.


Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice: 480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax: 480-965-7671 SHESC), 480-727-0709 (CSDC)
www: [www.public.asu.edu/~cmbarton], [http://csdc.asu.edu]

On Apr 3, 2010, at 12:07 PM, Helmut Kudrnovsky wrote:

>>> ---------------------
>>> Von: Michael Barton <[Michael.Barton at asu.edu]>
>>> In a related question, maybe more for Colin, does GRASS 7 work in
>>> Windows? If so, what is the setup to allow it to run the scripts in
>>> Python?
>>
>>
>> GRASS 7 works in Windows using a similar batch file to that which I
>> posted for 6.x. However, the Init.bat file needs some work. Starting
>> with -wxpython doesn't work (you can start it manually via g.gui,
>> though). If you start in -text mode, you'll get a couple of errors
>> about the missing set_data program, but you'll end up in a session
>> using the existing .grassrc7 file (provided that one exists).
>
> for testing there is a nightly build of WinGrass7:
>
> [http://grass.osgeo.org/download/software.php]
> [http://josef.fsv.cvut.cz/wingrass/grass70/]
>
> best regards
> Helmut


-- 
Isaac I Ullah, M.A.

Archaeology PhD Candidate,
ASU School of Evolution and Social Change

Research Assistant,
Mediterranean Landscape Dynamics Project
***************************************************
[isaac.ullah at asu.edu]
[ullah at archaeologist.com]

[http://www.public.asu.edu/~iullah]
***************************************************
___________________________________________________________
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1747 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/grass-user/attachments/20100410/1266c0b5/smime.bin


More information about the grass-user mailing list