then restore back to the line:>>> stdi,stdo,stde=sys.stdin,sys.stdout,sys.stderr>>> Reload (SYS)>> > sys.stdin,sys.stdout,sys.stderr=stdi,stdo,stdeprint sys.stdout"" at= "" 0x00000000027af320="" >> >> A careful person might think that afterReload (SYS) , if the standard input, standard output, and standard error output do not work, then the sentence behind relaod (SYS) sys.stdin,sys.stdout, How can sys.stderr=stdi,stdo,stde execute it? Therefore, af
0x00000000027af320>
>>> Print Sys.stderr
' ' W ' at 0x0000000001cab150>
>>>
So the problem is solved, but it has to be stressed:Never use reload (SYS) easily unless you completely erase the results! It is unwise to execute reload (SYS) just to be able to re-set Python's default encoding!The Python designer intentionally deletes the setdefaultencoding () method inside the sys module After the pyt
The. Reload/F Command forces the debugger to parse all the symbol files associated with the module immediately.
So I thought, is there any command to immediately remove all the symbol files associated with the module? I couldn't find it after searching for a long time, and finally found that the reverse command of.
, How can sys.stdout,sys.stderr=stdi,stdo,stde execute it? Therefore, after reload (SYS) , before the recovery, the standard input can still work properly, can be checked by the following code:So the problem is solved, but it has to be stressed:Never use reload (SYS) easily unless you completely erase the results! It is unwise to execute reload (SYS) just to be a
Why the command cannot be executed normally after Python IDLE reload (sys)
Generally, most people ExecuteReload (sys)This statement is only used to modify the default Character Set of Python, that is, to callSys. setdefaultencoding (). However, if you executeReload (sys), And the subsequent commands cannot be executed normally.
I was helpless when I first encountered this problem. Later I accidentally saw
Kill-1: A configuration file that reads the parameters again (similar to reload)This sentence gives me the feeling is to kill the process after the restart process, that is, reload. And I checked the man kill,-1 the corresponding signal is SIGHUP, with aFind/-perm +7000 >/dev/null 2>1 The order test is actually the killing process, bird brother said the reverse?
SIGHUP -hangup or exit a foreground
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.