当前位置:网站首页>Deepin, help ('command ') output saved to file

Deepin, help ('command ') output saved to file

2022-07-05 07:28:00 work-harder

background :deepin, python3.7, help(' command ') Save output to text file   .txt

Method :

1/ command Line interface , Input python -c 'import pygame; help(pygame.draw.arc)' > pygame_draw_arc.txt

 

remarks :

1/ use The following script failed : file pygame_draw_arc.txt Can produce , But nothing .help(' command ') Still output to the screen , I haven't found out yet .

import pygame

import sys

out_org = sys.stdout

sys.stdout = open('pygame_draw_arc.txt', 'w')

help(pygame.draw.arc)

sys.stdout.close()

sys.stdout = out_org

原网站

版权声明
本文为[work-harder]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140555475641.html