[GRASS-user] Problem using python to create GRASS mapset

Heinz Chen liebenhans at gmail.com
Mon Mar 31 10:10:06 PDT 2014


Sorry for asking questions to just helping me debug my python script, but I
really can't find where to be edited, and here's my script to generate new
mapset,

import osimport sys
#set up GRASS environment variables
sys.path.append(os.path.join(os.environ['GISBASE'], 'etc',
'python'))import grass.script as gimport grass.script.setup as gsetup
#create new mapset in the location
g.run_command('g.mapset' '-c' , mapset = 'watershed_analysis',
location = 'newLocation', gisdb =
'C:\Users\Heinz\Documents\grassdata')
#check resultprint g.read_command('g.mapsets' '-l')

The script runs fine but with no output, what mistake did I make?

I am using GRASS 6.4.3, python 2.7 under Windows 8.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140401/26e560f5/attachment.html>


More information about the grass-user mailing list