add doc for cmd.chcp

This commit is contained in:
Prodesire 2017-12-22 19:05:21 +08:00
parent 22703bbebf
commit d58adff648
1 changed files with 15 additions and 0 deletions

View File

@ -28,3 +28,18 @@ Cmd
>>> from pydu.cmd import cmdline_argv
>>> cmdline_argv()
['/Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py', '61253', '61254']
.. py:function:: pydu.cmd.chcp()
Context manager which sets the active code page number.
It could also be used as function.
>>> from pydu.cmd import chcp
>>> chcp(437)
<ctive code page number: 437>
>>> with chcp(437):
... pass
>>>
.. note:: ``chcp`` can only be used on ``Windows`` system.