Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python-docx - how to restart list lettering

Tags:

People also ask

How do you make a bulleted list in Python?

For a simple unnumbered(bulleted) list use the asterisk * "*". You can put linebreaks in the wiki markup of a list item by indenting the additional lines at the same level as the initial star that began the list item (without preceding it with an asterisk).


I'm automating the process of creating a Word document with the python-docx module. In particular, I'm creating a multiple choice test where the questions are numbered 1., 2., 3., ... and under each question there are 4 answers that should be labeled as A., B., C., and D. I used a style to create the numbered list and the lettered list. However, I don't know how to restart the letters. For example, the answers for the 2nd question would range from E., F., G., H. Does anyone know how to restart the lettering back to A? I could manually specify the lettering in the answer string but I'm wondering how to do it with the style sheet. Thank you.