[GRASS-user] Trying to use GRASS with Jupyter note books in Windows

Vaclav Petras wenzeslaus at gmail.com
Mon Oct 2 20:53:08 PDT 2023


On Thu, 28 Sept 2023 at 16:09, Vishal Mehta <vishalm1975 at gmail.com> wrote:

>
> Also, can I use bash within the jupyter notebook? I'm not familiar with
> the gs.script syntax; I'm very comfortable with the old bash ways..
> so any day I would rather
> glist rast than
> gs.list_grouped(type=['raster'])
>

That's really your choice as a user of Jupyter, GRASS GIS just provides the
Python API in addition to the command line interface. The command line
interface is there and you can use it from Bash or whatever else.


> What i'm hoping for is a way to mix and match within a single workflow,
> taking advantage of things like the interactive map via python
> what-have-you's, but sticking to the bash commands for pretty much
> everything else.
>

Use the exclamation mark lines in Jupyter (with IPython kernel). That
passes the line to your operating system. If you simply want general
command line syntax, that's the way to go on any platform. With that, you
can mix and match easily and that's relatively common thing to do. I'm
doing it a lot when experimenting, but for sharing I usually go with one
syntax which then needs to be Python.


> I saw some notebooks with something like
> %%bash
> <some bash commands>
>
> but that didn't work for me..
>

I would have to check, but the I would guess that your Windows does not
have Bash on path? This %%bash creates quite nice experience on Linux
(locally, cloud, etc.), but I don't know if it is the right choice on
Windows, but that's up to you to decide.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20231002/1b5f2861/attachment.htm>


More information about the grass-user mailing list