[Tutor] need help with a script..

Jerry Hill malaclypse2 at gmail.com
Wed Apr 11 15:59:56 CEST 2012


On Wed, Apr 11, 2012 at 9:50 AM, Khalid Al-Ghamdi <emailkgnow at gmail.com> wrote:
> Hi All,
>
> I'm using python 3.2 on a windows xp.
>
> I wrote the below script and ran it with the hope of returning a list of
> proctors (list_proc), but when it runs it  doesn't call the function
> convert_proctors() as intended. On the other hand, when i import the module
> from the IDLE prompt and call the convert_proctors() function, the function
> returns the desired list.
>
> Why is this so?

When you run that code as a script, it does call your
convert_proctors() function.  But since all you do is create a list,
and you never save it to disk, or print it to the screen, or even
assign it to a variable, the result is just thrown away.  Try changing
the last line to:

print(convert_proctors())

and you'll see the results you were expecting.

-- 
Jerry


More information about the Tutor mailing list