Closed nikozhoufromchina closed 8 months ago
You could try it from pptx.enum.text import PP_PARAGRAPH_ALIGNMENT
@sedrew Thank you for your guidance. It has been perfectly resolved. But I still feel curious, since "@ alias (" PP_ALIGN ")" cannot be directly referenced, what is the meaning of its existence?
@nikozhoufromchina it's more compact and in general these "aliases" are a little more meaningful to read. The original Microsoft names each come with a long history and are not always straightforward.
Aliases were originally defined using meta-programming, which works fine but obscures them from the type-checker. So in future these will be defined using regular enum.Enum
classes and aliases assigned by regular assignment, which type-checks fine and is a better all-around solution now that we don't have to accommodate Python 2.7 constraints anymore.
Unable to import "from pptx.enum.text import PP_ALIGN". I installed the latest version (v0.6.21) from GitHub. Does anyone know how to solve this issue?![image](https://github.com/scanny/python-pptx/assets/137739680/9ab283e4-cdbe-4627-827c-54e3979acd7f)