• Drizzel

    @Bumbo-Cactoni I'm a bit late to the party, but you could always check out Cambidge IGCSE Computer Science past papers. Just search for them in your favourite search engine. They provide beginner level excercises and solutions, since the exams are aimed at students with 2 years of coding experience.
    Just be aware that for every year, there's one paper with a coding excercise (the one you want) and one paper with theory (boring).

    I had to pass this exam in 2018, just as an example
    There's more here.

    posted in Pythonista read more
  • Drizzel

    @stephen I know this isn’t specific to your pen, but I really like how you progressively smoothed out the face. I use similar techniques with pen and paper, but I never thought of drawing like that digitally.

    posted in General Discussion read more
  • Drizzel

    @mikael said:

    Could you try to strip down (a copy of) your code

    Of course, no problem. It might take me one or two days, because I have exams coming up

    posted in Pythonista read more
  • Drizzel

    Since I have absolutely no clue how I caused this error, the following will be rather unspecific, my apologies

    So I have a very modified table view. Sometimes, when I remove some cell with the delete_rows() function, and then scroll down to see cells that weren’t displayed when deleting, some of these newly presented cells are totally blank. They simply are a white, empty area. I can tap them normally, and the proper functions are called. When I long press them (thanks to @mikael and his gestures script) I get the following error:

    Traceback (most recent call last):
      File "/private/var/mobile/Containers/Shared/AppGroup/D1D9102B-9BBB-4003-A835-39FDFDA39AB1/Pythonista3/Documents/v9/play_view.py", line 50, in skip_action
        self.player.finished_handler()
      File "/private/var/mobile/Containers/Shared/AppGroup/D1D9102B-9BBB-4003-A835-39FDFDA39AB1/Pythonista3/Documents/v9/audio_manager.py", line 72, in finished_handler
        section = prev_cell.section
    AttributeError: '_anonymous_label' object has no attribute 'section'
    

    So what is an _anonymous_label, and how did I cause this?

    I’m really sorry that I’m so unspecific, I simply have no idea how my (pretty long) code got to this

    posted in Pythonista read more
  • Drizzel

    @Karina Yeah, we have a little “chicken house” and I wrote a script that opens and closes the door by turning on and off a motor. But that’s not the point :) I just needed an example to better illustrate the uses of threads

    posted in Pythonista read more
  • Drizzel

    @Karina Now yes, threads may not always speed up your program. But they can keep your program responsive even though there’s some time consuming task being done. I also sometimes use them to constantly check if a variable changed, and then trigger a function. (There’s better ways to do that. But hey, I’m learning too.)

    Even though this is in no way specific to Pythonista, let’s take a slight detour. Some time ago, I built a door manager for the chicken pen of my family (yeah, it’s a bit unusual). It opens and closes the door at given times, but also constantly checks a button and email for a manual overrides. Since the button needs to be checked every 0.1 seconds, but checking the email takes about 4 seconds (establishing a connection to the google servers takes some time), the button wouldn’t be checked while the code is trying to get the new email. This is solved with threads, so they get checked in parallel, not after each
    Therefore the button stays responsive, even though checking mails uses up a lot of time

    posted in Pythonista read more
  • Drizzel

    @Karina said:

    I began to read about threads and sometimes don't understand what about this all, but in general understand. And for what here to use them? It encreases the speed of smth?

    I certainly don’t know everything about threads either, but here’s my understanding of them.

    The basics:

    • I think of threads like... well threads, as in strings or a thin rope. And when you open a thread, the code in this thread is run separated to other threads.

    • Thus Threads allow for separate codes to run “at the same time” (this technically isn’t possible, and is done through some tricks so that it appears so. Thus the quotation mark. But I’m not here to confuse you, so let’s go on)

    • Therefore you can have one section of code that (for example) has a time.sleep(100000) in it, and a thread that prints stuff in an infinite loop. Since they run in different threads, your code will still print stuff, even though there’s a stupidly long sleep statement in it

    Edit If you want some coding examples, I can write you some with comments

    posted in Pythonista read more
  • Drizzel

    @stephen looking good! I always was a little too lazy to try them all out... and I’m not using scene much nowadays.

    posted in Pythonista read more
  • Drizzel

    @Karina I think you got me mixed up with @stephen :) And yes, I do prefer to fix the node‘s position manually.

    My version of flappy bird I posted here some days ago is a good example. I used basic physics formulas to give the bird an acceleration, and then use that to calculate the bird‘s speed and thus position at a given time. Then adjusting the gravity and weight parameters made the motion feel “just right” (in my opinion).

    Technical stuff aside, I just do it for greater control, so I can get the feeling of motions right.

    posted in Pythonista read more
  • Drizzel

    @Karina I haven’t used Actions much, I prefer animating nodes myself. But theoretically, from reading the docs, your code should work (assuming your indentation is correct and your actual code doesn’t miss the closed bracket at the end)

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!