title: How to create MUC and send messages to existing MUC using Python and XMPP
body: <p>I was wondering if anyone here can provide some code samples on the following scenarios. I'm particularly interested in using xmpppy to do this as I'm already using the library for my app, but other libraries ok too. It is unfortunate that the xmpppy project website doesn't have any samples on this. Browsing the expert/advanced API docs, I couldn't figure out how to do it, or is multi-user chat (MUC) not supported with xmpppy?</p>
  
  <ul>
  <li><p>create a MUC by inviting specific users (say 2 or 3)</p></li>
  <li><p>send message to an existing MUC (assuming you know it's MUC JID handle or nickname)</p></li>
  <li><p>look up existing MUCs on the XMPP server, getting the JID or nickname, etc. If this is done by getting roster, we want to only look for MUCs, ignoring users.</p></li>
  </ul>
  
  <p>I found sort of an answer here, but then I'd probably have to learn new library API calls and figure out how to do my above mentioned scenarios as this sample doesn't cover all of them:</p>
  
  <p><a href="https://stackoverflow.com/questions/2364039/pyxmpp-quick-tutorial-for-creating-a-muc-client">pyxmpp: quick tutorial for creating a muc client?</a></p>
  
  <p>I'm really looking to do a load generator that pumps messages to MUCs and creating large MUCs with many participants. I've already got the part in place for pumping messages to user recipients.</p>