The idea is basically to pass all the documentation to a txt
import socket
archivo=('sockets.txt','w')
archivo.write(help(socket))
archivo.close()
The idea is basically to pass all the documentation to a txt
import socket
archivo=('sockets.txt','w')
archivo.write(help(socket))
archivo.close()
I don't know what reason you have for doing this, if by any chance you would like to have the complete Python documentation offline, you can download it from the official website . You have it in EPUB, PDF, HTML and plain text.
That said, you can do what you want by using pydoc to generate the documentation and get back a string. You just have to save that string in the txt:
This creates a nice txt that starts like this:
The code is valid for Python 3.x, although the same idea can be followed for Python 2.x (just modify the theme of the argument
rendered
).