2017-03-23 2 views
0

Python-docx를 사용할 때, pycharm wing과 같은 IDE는 자동 완성을 할 수 없습니다. 이 코드내 IDE가 python-docx에 대해 자동 완성을 할 수없는 이유는 무엇입니까?

from docx import Document 

asd = Document() 
asd.add_heading("test") 
asd.save("cao.docx") 

내가 타이핑 할 때. add_heading은 자동 완성을 할 수 없습니다.

from docx.document import Document 

asd = Document() 
asd.save() 
this code can Auto-Complete 
but atention 

형식 오류 : 초기화()이 개 필요한 위치 인수 누락 '요소'와 '부분'

나는 후자의 경우에 불쌍한 내 영어

답변

0

에 대한 죄송를, 당신 실수로 docx.Document이 아닌 docx.document.Document을 가져오고 있습니다. 클래스의 docx.document에는 다른 호출 서명이 있습니다. 어떤 경우 든 원하는 사람이 아닙니다.