[Chicago] FW: strange None tailing

Carl Karsten carl at personnelware.com
Fri Apr 12 04:56:31 CEST 2013


Um, main() never gets called.

Carl K


On Thu, Apr 11, 2013 at 9:45 PM, shangyu <yushang at outlook.com> wrote:
> Sorry , the correct code is
>
> def test(f):
>   print >>f, "zzzz"
>
> def main():
>   f = open("test.cfg","w")
>   test(f)
>   f.close()
>
> ________________________________
> From: yushang at outlook.com
> To: chicago at python.org
> Subject: strange None tailing
> Date: Fri, 12 Apr 2013 10:41:44 +0800
>
>
> Hi dear all,
> I've wrote the following Python code :
>
> def test(f):
>   print >>f, "zzzz"
>
> def main():
>   f = open("test.cfg","w")
>   test(f)
>   f.close(
> when open the test.cfg file I got the following lines
> zzzz
> None
>
> Why there is such a strange None output ?
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>


More information about the Chicago mailing list