+ 1

Python using string from help()

Using the modules sys and docx I would like to write a script that takes a key word from the command line and writes help(keyword) in a Word document. But help(keyword) does not return a string. Is it possible to access the text from the help function in a script? Help(help) did not help ;-)

14th Jun 2020, 3:37 PM
Rüdiger Henze
Rüdiger Henze - avatar
3 odpowiedzi
+ 5
I think manipulating with standard output might be of a help() here :) If you can temporarily redirect the output from the screen to a file, will that help in your task? Check this out: https://code.sololearn.com/cFwAQNRmqn9G/?ref=app
14th Jun 2020, 4:13 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 3
Yes this works, thanks
14th Jun 2020, 4:47 PM
Rüdiger Henze
Rüdiger Henze - avatar
0
what about using back slash. \ ?
11th Aug 2020, 6:21 PM
Azad m. A.
Azad m. A. - avatar