Skip to content

Instantly share code, notes, and snippets.

View dtbao20's full-sized avatar
🌴
try

Dinh Bao dtbao20

🌴
try
View GitHub Profile
@Guhan-SenSam
Guhan-SenSam / 1info.md
Last active May 19, 2024 18:59
Methods to Optimizing Kivy Performance

Many people state that kivy is slow. While this may be true it is mostly due to that python is slow to run on android devices.Thus it is in the programmer's hands to properly optimize their code so as to create a performant application.

Most of the lag on android devices runing kivy apps arise due to widget creation. Widget creation remains the slowest step in a kivy app. Here are some of the methods that I follow to optimize my apps and ensure I can hit 60fps even on old devices

Optimization Methods:

@dtbao20
dtbao20 / turtle_christmas.py
Last active January 6, 2024 09:45
🎄merry christmas!🎅
# convert from https://www.dwitter.net/d/26619
from turtle import *
bgcolor(0,0,0), setup(500,500)
hideturtle(), tracer(False), penup()
def rect(x=0, y=0, w=100):
goto(x,y)
begin_fill()
[ forward(w) or left(90) for _ in range(4) ]
end_fill()
# inspired by https://www.dwitter.net/d/28950
from turtle import *
bgcolor(0,0,0), setup(500,500)
hideturtle(), tracer(0), penup()
from math import sin, cos
from time import perf_counter
def _Oneo_Kuu():
update(), clear()
t = perf_counter()
# convert from dwitter.net/d/26555 --By hoplite
from turtle import *
bgcolor("#000"), setup(500,500)
hideturtle(), tracer(0), penup()
getcanvas().winfo_toplevel().wm_attributes("-transparentcolor", "#000")
getcanvas().winfo_toplevel().attributes('-fullscreen', True)
from math import sin, cos
from time import perf_counter
w = 500
@williamchange
williamchange / AddSubPathNumber.py
Last active May 13, 2024 00:11
Add two buttons to - / + file number in the output panel (output properties)
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#