Project

General

Profile

Python cdo binging - sinfo, showyear,griddes dont print anything!

Added by Thomas Kroißenbrunner about 2 years ago

Hello everyone!

I have a problem with my python cdo binding!

I want to show some info of a file in my python console, but it simply doesnt work! It doesnt print anything in my console! My python bindings works when i want merge files, sellonlatbox and things like that, but it just wont show any info in my console.

here is my code:

sel_time = cdo.selyear('1850/1900',input = infile)
cdo.showyear(input=infile)
cdo.info(input=infile)
cdo.info(input=sel_time)

Basically i want to see if selyear works as i want it to, and show the info of the new data in sel_time. showyear and info with input=infile are just to see if i can see information directly from the source file, but none of the above work.
Any help is appreciated, thank you very much!

Replies (2)

RE: Python cdo binging - sinfo, showyear,griddes dont print anything! - Added by Ralf Mueller about 2 years ago

hi thomas!

do you work in an interactive shell?

these calls return a string, but your lines do not print them. in an interactive shell, they would be printed automatically, but not in a normal script.

cheers
ralf

RE: Python cdo binging - sinfo, showyear,griddes dont print anything! - Added by Thomas Kroißenbrunner about 2 years ago

Hi ralf,

Thank you very much, that worked now!

cheers!

    (1-2/2)