returning results from function

Chris Rebert crebert at ucsd.edu
Thu Nov 11 22:54:58 CET 2010


On Thu, Nov 11, 2010 at 1:16 PM, Neil Berg <nberg at atmos.ucla.edu> wrote:
> Hi Python community,
>
> In a main script, I pass the year (yr), month (mo), day (dy) and hour(hr) into the utc_to_local function (pasted below) which converts that date and time into local standard time.  I am passing several dates and times into this function and would like to work with the "returned" loc_y/m/d/h values,
> but no output is visibly seen when I run the main script.

Does the main script print() the returned values? Python doesn't
output stuff unless you explicitly ask it to (except when you're using
the REPL). Show us your main script, or at least the part of it where
utc_to_local() is called.

> I want the "return" command to just return the values to me in the main script so I can work with them!

It already does that. The problem must lie with the caller (i.e. the
main script).

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list