The help documentation for python is very good, that is, sometimes the Help page is provided several times, and even some help cannot be seen at all (I think there should be other methods to solve it, but I don't want to check it ), this can be done through a very simple Python script.
Here is an example. For example, if I want to get the help document of tkinter, in interactive mode, I can enter:
>>> Import tkinter
>>> Help (tkinter)
Press enter to see the spectacular screen flushing effect ...... When you scroll the mouse to see the help document, you will find that you cannot find it.
This is clearly not what I need.
Maybe I should not input this type. I input this type, resulting in excessive output.
But the fact is that I really need all the documents about tkinter. What should I do?
I think it is as follows:
File: getpythonhelp2.py:
Code:
#! /Usr/bin/Python
ImportTkinter
Help (tkinter)
Usage:
Python getpythonhelp2.py> 1.txt
Direct output is redirected to a file. It is very convenient to view the disk. Haha ......
In fact, there is a more lazy approach. Here we only provide a demo:
1 # ! /Usr/bin/Python
2 '''
3 File: getpythonhelp. py
4 Author: Mike
5 E-mail: Mike_Zhang@live.com
6 '''
7 Import Tkinter
8 Import Sys
9
10 TMP = SYS. stdout
11 Fp = open ( " 1. txt " , " W " )
12 SYS. stdout = fp # Redirect stdout
13 Help (tkinter)
14 SYS. stdout = TMP # Recover stdout
15 FP. Close ()
This is my previous article.Article(Http://www.cnblogs.com/MikeZhang/archive/2012/01/19/ioRedirect.html) mentioned inProgramThe implementation of internal Io redirection is similar in principle.
Okay, that's all. I hope it will help you.