This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年11月12日 06:51 by firatozgul, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg175419 - (view) | Author: Firat Ozgul (firatozgul) | Date: 2012年11月12日 06:51 | |
On Python 3.3 under Windows and GNU/Linux, sys.stdout.write prints the length of string along with the string itself:
>>> sys.stdout.write("a_string")
a_string8
Note the '8' at the end of 'a_string'.
Is it expected behavior?
|
|||
| msg175420 - (view) | Author: Firat Ozgul (firatozgul) | Date: 2012年11月12日 07:22 | |
Although I do not know the reason for change, it seems that this is expected behavior as of Python 3.0 in interactive shell. Closing the record as 'invalid'. |
|||
| msg175421 - (view) | Author: Kushal Das (kushal.das) * (Python committer) | Date: 2012年11月12日 07:23 | |
sys.stdout.write returns the length of the string it printed.
try these:
x = sys.stdout.write("abc")
print x
or from console
python -c 'import sys ; sys.stdout.write("abc")'
|
|||
| msg175422 - (view) | Author: Firat Ozgul (firatozgul) | Date: 2012年11月12日 07:28 | |
Thank you for the explanation, kushaldas. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:38 | admin | set | github: 60663 |
| 2012年11月12日 07:44:42 | ezio.melotti | set | type: behavior components: - None stage: resolved |
| 2012年11月12日 07:28:04 | firatozgul | set | messages: + msg175422 |
| 2012年11月12日 07:23:31 | kushal.das | set | nosy:
+ kushal.das messages: + msg175421 |
| 2012年11月12日 07:23:10 | firatozgul | set | status: open -> closed |
| 2012年11月12日 07:22:44 | firatozgul | set | resolution: not a bug messages: + msg175420 |
| 2012年11月12日 06:51:28 | firatozgul | create | |