@Mu Xu ,
Thanks for reaching out to Q&A.
You can use the Azure service bus sdk for python to write messages to session enabled service bus queue. Please refer following example,
https://learn.microsoft.com/en-us/python/api/overview/azure/servicebus-readme?view=azure-python#send-and-receive-a-message-from-a-session-enabled-queue
I have converted the comment to answer so that it helps others in the community as well.