• JonB

    I'm pretty sure that shortcuts can't simulate taps into other apps. That would be a huge security risk.

    posted in General Discussion read more
  • JonB

    What type of signal processing do you need? Pythonista has numpy, so you can do certain types of processing easily (and other types with some effort)

    posted in General Discussion read more
  • JonB

    Ffmpeg cannot be installed on pythonista. Blame Apple.

    Technically, it might be possible to use the emacriptm port in a webview
    here but I've got to think it will be really slow.

    posted in Pythonista read more
  • JonB

    I believe mqtt would work -- I think it has ack/resend capability for example -- though may also be overkill. One peer would act as server (broker in mqtt parlance), and maybe would also have to run the client as well, though maybe not.

    posted in Pythonista read more
  • JonB

    @shinyformica when you say messaging, are talking about "chat" app? Or literal low level messaging for some sort of client/server application?

    I have used MQTT on embedded projects before. This is a subscribe/publish style messaging system, usually used for things like sensor data logging/distribution and control, but it is fairly low overhead and could be used as the transport for peer to peer comm. There are pure python implementations (I have used the micropython version, but there are at least a half a dozen different client implementations, a lot fewer python broker implementations that I could find)

    Of course, there is also
    https://github.com/mikaelho/multipeer

    Which uses iOS frameworks for setting up the connection.

    For very simple applications you might get by with the built in asynchat module. For example
    https://pymotw.com/2/asynchat/

    posted in Pythonista read more
  • JonB

    here is a very simple example using the built in exAmple:

        def touch_began(self,touch):
            if touch.location.x>.7*self.size.w:
                self.x_move_dir=+1
            if touch.location.x < .3*self.size.w:
                self.x_move_dir=-1
        def touch_ended(self,touch):
                self.x_move_dir=0
    

    then, you replace g.x in update_player with self.x_move_dir.
    you could have a similar logic for y motion.

    of course, this method doesnt work for multiple fingers. for that you need to keep a dictionary of touches, that gets set in touch_began (use touch.id as the key). you update the touch in touch_moved, and delete it in touch_ended. then, in your update function, you have to cycle through the active touches to see what is currently being pressed each cycle.

    posted in Pythonista read more
  • JonB

    You might consider scene instead of UI. Scene would let you animate the piece motions more naturally for example.

    posted in Pythonista read more
  • JonB

    The code isn't mine. I just adapted the speaker and screen support.

    posted in Pythonista read more
  • JonB

    Try

        img = 'rectangle_1.png'
        self.background_color = 'white'
        if img in os.listdir(): print('yes')            
        printt(ui.Image.named(img)) 
    

    You were checking one file, but trying to open a different one

    posted in Pythonista read more
  • JonB

    I am in the process of swapping out the screen code on applepy, and adding in kb support. While the screen drawing code is reasonably fast, the actual emu code is horrendously slow. So this isn't actually a viable solution for anything "real".

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!