• FarmerPaco

    Hi @ywangd
    Love Stash.

    Is there any reason I am getting ‘Repository/branch not found’ when running selfupdate?

    I’m on
    StaSh v0.6.19
    Pythonista 3.2 (320000)
    iOS 11.3.1 (64-bit iPad5,3)
    root: ~/Documents/site-packages/stash
    stash.py: 2018-01-01 12:59:22
    SELFUPDATE_BRANCH: master

    posted in Pythonista read more
  • FarmerPaco

    @Tito I think Learn Python the Hard Way is actually a great learning tool. If you bought Zed’s course then you have a great community there to ask questions as well.

    Plus learning to work in Bash will help later if you want to try some physical computing later with a raspberry pi (lots of fun).

    If you want to mimic Bash a bit in Pythonista there is always Stash.

    posted in Pythonista read more
  • FarmerPaco

    I would gladly pitch in for a crowdfunding project. I am sure there are a lot of experienced users with lots of great projects that would shine a little on how to make the most out of this amazing app.

    posted in Pythonista read more
  • FarmerPaco

    @abcabc thanks a lot. One of the amazing thing about these forums is that people (like you) help out with great examples and no snark. I am really grateful. And hopefully when I have greased my wheeels a bit more I will also be to help others out.

    So thanks again for pointing out my mistake.
    The polygon you included also really helps understand the syntax better!

    posted in Pythonista read more
  • FarmerPaco

    So I am playing around with the Game Module and I have enjoyed swapping out coins for snowflakes and then slowed them down for a beautiful snowy day, but I want to do this with a ShapeNode and can't seem to figure it out..

    class Coin (SpriteNode):
        def __init__(self, **kwargs):
            
            SpriteNode.__init__(self, 'emj:Snowflake', **kwargs)
    

    If anyone can point me in the right direction to use a circle (ui.Path.oval) instead of a texture.
    It tried this

    class Ball(ShapeNode):
        def __init__(self, **kwargs):
            
            circle = ui.Path.oval (0, 0, 20, 20)
                    
            theball = ShapeNode(circle,'red', stroke_color='clear', shadow=None)
            
            ShapeNode.__init__(self, theball, *kwargs)
    

    And it tells me the ShapeNode object has no attribute bounds.
    Thanks in advance to anyone who can help.

    posted in Pythonista read more
  • FarmerPaco

    Always grateful for each update. I use this app for education. Each update means I have a better and more powerful learning tool for my students.
    Thanks a million.

    posted in Pythonista read more
  • FarmerPaco

    Do you mind posting the final script with the changes. I would love to see how it turned out.
    Thanks in advance.
    farmerPaco

    posted in Pythonista read more
  • FarmerPaco

    Thank you Ole, this is what I was looking for, and thank you especially for taking time to answer bye so I can see the difference.

    I want to mention that I use your app at a code school in Matsumoto, Japan. Until now I have taught with a block code app called Hopscotch but we needed to move up and I decided Python over Ruby. Your app makes it possible to learn Python on iPad.

    I am very grateful for this. Your app is a huge win for education!

    posted in Pythonista read more
  • FarmerPaco

    @Phuket2 Thanks for the guidance. I made a simpler version which runs smoothly, but I am still using Scene. Was hoping someone could show me or point me in a better direction.

    This is the improved version tha doesn't choke on memory.

    from scene import *
    import time
    import colorsys
    colors = []
    
    for i in range(0, 100, 1):
        b = i / 100.0
        color = colorsys.hsv_to_rgb(0.56, 0.88, (b))
        colors.append(color)
    
    
    i = 0
    class sunsetScene(Scene):
        def setup(self):
            # get starting time
            self.start_time = time.time()
            global i
            self.background_color = 'black'
            
        def update(self):
            global i
            # update background color after .1 seconds
            if time.time() - self.start_time > .1:
                
                self.background_color = colors[i]
                if i <  (len(colors)-1):
                    i+=1
                self.start_time = time.time()
                
                
    main_view = SceneView()
    main_view.scene = sunsetScene()
    main_view.present(hide_title_bar=True, animated=False)```

    posted in Pythonista read more
  • FarmerPaco

    Okay, so I tried to work it out, and it does work but I know there is a better way. Any hints? Please help.

    Here is my last version:

    from scene import *
    import time
    import colorsys
    colors = []
        
    for i in range(0, 100, 1):
        b = i / 100.0
        color = colorsys.hsv_to_rgb(0.56, 0.88, (b))
        colors.append(color)
        print(color)
    
    
    
    i= -1
    class sunsetScene(Scene):
        def setup(self):
            # get starting time
            self.start_time = time.time()
            global i
            if i <  (len(colors)-1):
                i+=1
            SpriteNode(anchor_point=(0, 0), color= colors[i], parent=self,
                       size=self.size) 
            
        def update(self):
            # move to new scene after 2 seconds
            if not self.presented_scene and time.time() - self.start_time > .2:
                self.present_modal_scene(sunsetScene())
                
    main_view = SceneView()
    main_view.scene = sunsetScene()
    main_view.present(hide_title_bar=True, animated=False)
    

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!