[SPAM] New PyGrADS 1.0.8, works on Windows

Arlindo da Silva dasilva at ALUM.MIT.EDU
Tue Apr 8 12:40:08 EDT 2008


2008/4/8 黄平 <ph0007 at ustc.edu>:

> Hi,Arlindo
> I installed "pygrads-1.0.8.win32_superpack.exe"
>
> After one afternoon's fumble, I have some preliminary understanding about
> PyGrads and achieve some simple task.
>
> There is a little  question: how to send the Python variables to GrADS
> when I want set the attributes.
>
> For example:
> in GrADS Scripting Language
> x1=1
> x2=5
> y1=1
> y2=3
> 'set parea 'x1' 'x2' 'y1' 'y2
>
> How to achieve this function in PyGrads simply?
>

Here is one way:

bbox = (1,5,1,3)
ga('set parea %d %d %d %d'%bbox)

and another

x1 = 1
x2 = 5
y1 = 1
y2 = 3
ga('set parea %d %d %d %d'%(x1,x2,y1,y2))

You just pass a string to the ga() instance with the command you want to
execute. In these examples I am using tuples and standard string formating
operations in Python. Take your time to read the Python Tutorial,

      http://docs.python.org/tut/

You can use pygrads from the command line without knowing much about Python,
but
you will need to learn the language if you would like to program in it.

     Good Luck,

           Arlindo

-- 
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080408/bd3b6727/attachment.html 


More information about the gradsusr mailing list