Skip to content
View villares's full-sized avatar
💥
💥

Organizations

@garoa @arteprog @clube-de-leitura-python

Block or report villares

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
villares/README.md

animação Hello World

This animation is made with points in a Python collections.deque data structure, added by dragging the mouse (code bellow).

from collections import deque  # a double-ended queue
import py5  # check out https://github.com/py5coding 

history = deque(maxlen=512)  # mouse dragged positions

def setup():   # py5 will call this once to set things up
    py5.size(600, 400)
    py5.no_stroke()
    py5.color_mode(py5.HSB)

def draw():   # py5 will call this in a loop
    py5.background(51)
    for i, (x, y) in enumerate(history):
        py5.fill(i / 2, 255, 255, 128)
        py5.circle(x, y, 8 + i / 16)
    history.rotate(-1)  # Thank you Ramalho! Previously `if h: h.append(h.popleft())`

def mouse_dragged():  # py5 will call this when you drag the mouse
    history.append((py5.mouse_x, py5.mouse_y))
    
def key_pressed():   # py5 will call this when a key is pressed
    history.clear()

py5.run_sketch()
  • 💬 Ask me about drawing with Python!
    • Check out py5 and my modified pyp5js hack, they bring in the vocabulary from Processing & P5js!
    • I try to make a new drawing with code everyday, and I put the results at skech-a-day.
  • 🔭 I have just finished a PhD at Unicamp by the end of 2025. I have very little idea of what I'm going to do now...
  • 👯 I’d like to collaborate on open resources to teach programming.
  • 📫 How to reach me: Mastodon or Email.
  • ⚡ Fun fact: I actually use this repo to store some helper code I use in my drawings.
  • ⏰ I'm slowly moving stuff to codeberg.org/villares

Pinned Loading

  1. sketch-a-day sketch-a-day Public

    One visual idea a day

    Python 248 20

  2. py5coding/py5generator py5coding/py5generator Public

    Meta-programming project that creates the py5 library code.

    Python 65 15

  3. thonny-py5mode thonny-py5mode Public

    Forked from py5coding/thonny-py5mode

    A py5 plug-in for Thonny

    Python

  4. thonny-portable-with-py5 thonny-portable-with-py5 Public

    5

  5. py5examples py5examples Public

    Forked from py5coding/py5examples

    py5 example code and tutorials

    Jupyter Notebook 4 2