• OTPSkipper

    I think just keeping the iPad active will be enough. I don't really need it to run in the background. Thanks!

    posted in Pythonista read more
  • OTPSkipper

    Is there a way to enable operation in the background?

    I have an app that receives a data stream from a socket over wifi from my sailboat. The problem is I am not interacting with the app all the time. I want to be able to put it down but still collect the data.

    When I close the top on my iPad right now it gets an io error on the socket after about 150 seconds.

    posted in Pythonista read more
  • OTPSkipper

    Got it. There is setter code in the library and I was overriding it. Here is the fixed code:

    from scene import Scene, SpriteNode, run, EffectNode
    
    class pt(SpriteNode):
        
        def __init__(self, **kargs):
            SpriteNode.__init__(self, 'plf:HudX', **kargs)
            self.scale = 0.5
            
    class plot (SpriteNode):
        def __init__(self, **kargs):
            SpriteNode.__init__(self, **kargs)
            self.anchor_point = (0, 0)
            self.color = '#8989ff'
        
    class test(Scene):
        
        def setup(self):
            clip = EffectNode(parent=self)
            clip.crop_rect = (0, 0, self.size.x / 2, self.size.y / 2)
            pane = plot(parent=clip)
            pane.size = (self.size.x / 2, self.size.y / 2)
            clip.position = (50, 50)
            
            for x in (50, 100, 150, 200, 250, 300, 350, 400):
                p = pt(parent=pane)
                p.position = (x, x)
                
    if __name__ == '__main__':
        tst = test()
        run(tst)
            
            ```

    posted in Pythonista read more
  • OTPSkipper

    Thanks. That is working for me.

    posted in Pythonista read more
  • OTPSkipper

    It was something stupid. Spelled the reference to the file Handel wrong.

    Thanks!!

    posted in Pythonista read more
  • OTPSkipper

    Here is my test case:

    from scene import Scene, SpriteNode, run, Point
    
    class pt(SpriteNode):
        
        def __init__(self, **kargs):
            SpriteNode.__init__(self, 'plf:HudX', **kargs)
            
        scale_x = 0.5
        scale_y = 0.5
            
    class plot (SpriteNode):
        anchor_point = Point(0,0)
        color = '#8989ff'
        
    class test(Scene):
        
        def setup(self):
            pane = plot(parent=self)
            pane.size = (self.size.x / 2, self.size.y / 2)
            pane.position = (50,50)
            
            for x in (50, 100, 150, 200, 250, 300):
                p = pt(parent=pane)
                p.position = (x, x)
                
    if __name__ == '__main__':
        tst = test()
        run(tst)
    

    Questions:

    1. Why doesn't the color work on my plot class?
    2. Why isn't the plot 50 px from the lower left corner?
    3. Why are the x gifs not half size?
    4. Why doesn't the plot Sprite clip its children?

    posted in Pythonista read more
  • OTPSkipper

    Simple enough. Logfile_out is set to "log.txt"

      if self.logfile_out is not None:
            self._of = open(self.logfile_out, mode='w', encoding='utf-8')
    

    It has to be something stupid.

    posted in Pythonista read more
  • OTPSkipper

    Hmmm. Tried that and it didn't seem to work. No file showed up.

    posted in Pythonista read more
  • OTPSkipper

    How can I save a log file to my pythonista file system?

    posted in Pythonista read more
  • OTPSkipper

    I am writing an app that receives data over a tcp socket and displays the data graphically with some user interaction too.

    I can't just call "run" for scene support because I need to poll the socket too.

    Will threads work?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!