omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Multipeer Connectivity

    Pythonista
    2
    2
    1760
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mikael
      mikael last edited by

      Please check the repo for a Pythonista wrapper around iOS Multipeer Connectivity.

      Multipeer connectivity allows you to find and exchange information between 2-8 iOS and Mac devices in the same network neighborhood (same wifi or bluetooth), without going through some server.

      Sample use cases include games, chats, file exchange (like AirDrop) and so on.

      Here's a minimal usage example, a line-based chat. You need to be running the same code on all devices participating in the chat.

      import multipeer
      
      my_name = input('Name: ')
      
      mc = multipeer.MultipeerConnectivity(display_name=my_name, service_type='chat')
      
      try:
        while True:
          chat_message = input('Message: ')
          mc.send(chat_message)
      finally:
        mc.end_all()
      

      You can also run the multipeer.py file to try out a cleaner Pythonista UI version of the chat.

      Thanks to @wolf71 for driving the initial effort 2 years ago. Heavy lifting on the ObjC side was all on @JonB, and @dgelessus' faulthandler was again indispensable in debugging ObjC crashes. Kudos to @mithrendal for fixing the last showstopper.

      1 Reply Last reply Reply Quote 2
      • wolf71
        wolf71 last edited by

        @mikael Great Job. Thanks

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors