Please help with Threading

Carlos Nepomuceno carlosnepomuceno at outlook.com
Mon May 20 22:53:46 EDT 2013


sys.stdout.write() does not suffer from the newlines mess up when printing from many threads, like print statement does.

The only usage difference, AFAIK, is to add '\n' at the end of the string.

It's faster and thread safe (really?) by default.

BTW, why I didn't find the source code to the sys module in the 'Lib' directory?

----------------------------------------
> Date: Tue, 21 May 2013 11:50:17 +1000
> Subject: Re: Please help with Threading
> From: rosuav at gmail.com
> To: python-list at python.org
>
> On Tue, May 21, 2013 at 11:44 AM, 88888 Dihedral
> <dihedral88888 at googlemail.com> wrote:
>> OK, if the python interpreter has a global hiden print out
>> buffer of ,say, 2to 16 K bytes, and all string print functions
>> just construct the output string from the format to this string
>> in an efficient low level way, then the next question
>> would be that whether the uses can use functions in this
>> low level buffer for other string formatting jobs.
>
> You remind me of George.
> http://www.chroniclesofgeorge.com/
>
> Both make great reading when I'm at work and poking around with random
> stuff in our .SQL file of carefully constructed mayhem.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list 		 	   		  


More information about the Python-list mailing list