Skip to content

Instantly share code, notes, and snippets.

from kivy.app import App
import numpy as np
def generate_mesh(p, radius=100):
angles = np.linspace(0, 2*np.pi, 100)
centre = np.array([0, 0.]) + radius
xs = (radius * np.sin(angles))
ys = (radius * np.cos(angles))
diff --git a/pythonforandroid/recipes/android/__init__.py b/pythonforandroid/recipes/android/__init__.py
index f8b37c5..e2dcefb 100644
--- a/pythonforandroid/recipes/android/__init__.py
+++ b/pythonforandroid/recipes/android/__init__.py
@@ -13,7 +13,7 @@ class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
src_filename = 'src'
- depends = [('pygame', 'sdl2'), ('python2', 'python3')]
+ depends = [('pygame', 'sdl2', 'webviewjni'), ('python2', 'python3')]
10-02 20:58:42.340 2163 3556 I ActivityManager: Start proc 16324:org.test.pyrfda:python/u0a218 for activity org.test.pyrfda/org.renpy.android.PythonActivity
10-02 20:58:42.392 16324 16324 V python : metadata fullscreen is0
10-02 20:58:42.419 16324 16337 E linker : warning: unable to get realpath for the library "/data/app/org.test.pyrfda-1/lib/arm/libpython2.7.so". Will use given name.
10-02 20:58:42.420 16324 16337 W linker : /data/app/org.test.pyrfda-1/lib/arm/libpython2.7.so: is missing DT_SONAME will use basename as a replacement: "libpython2.7.so"
10-02 20:58:42.428 16324 16337 E linker : warning: unable to get realpath for the library "/data/user/0/org.test.pyrfda/files/lib/python2.7/lib-dynload/_io.so". Will use given name.
10-02 20:58:42.428 16324 16337 W linker : /data/user/0/org.test.pyrfda/files/lib/python2.7/lib-dynload/_io.so: is missing DT_SONAME will use basename as a replacement: "_io.so"
10-02 20:58:42.429 16324 16337 E linker : warning: unable to get realpath for the library "/data/u
This file has been truncated, but you can view the full file.
packages are []
running apk
[INFO]: Will compile for the following archs: armeabi
[INFO]: Getting Android API version from user argument
[INFO]: Available Android APIs are (14, 15, 19, 21, 25)
[INFO]: Requested API target 19 is available, continuing.
[INFO]: Getting NDK dir from from user argument
[INFO]: Got NDK version from from user argument
[INFO]: Using Crystax NDK 10.3.2
[INFO]: Found virtualenv at /usr/bin/virtualenv2
315 dessant
187 Peter Badida
132 Matthew Einhorn
127 matham
110 Zen-CODE
72 Akshay Arora
46 Meet Udeshi
43 Mathieu Virbel
40 Rafał Kaczor
31 fruitbat
from math import sin, cos
def circle_angles_to_points(start_angle, end_angle, radius, num_points, origin=[0, 0]):
points = []
for i in range(num_points):
angle = start_angle + i * (end_angle - start_angle) / (num_points - 1)
x = radius * cos(angle) + origin[0]
y = radius * sin(angle) + origin[1]
points.append((x, y))
return points
from pythonforandroid.toolchain import CythonRecipe, shprint, current_directory, ArchARM
from os.path import exists, join
import sh
import glob
class FionaRecipe(CythonRecipe):
version = '1.7.11'
url = 'https://github.com/Toblerity/Fiona/archive/{version}.zip'
name = 'fiona'
from kivy.uix.textinput import TextInput
class YourTextInput(TextInput):
def insert_text(self, text, from_undo=False):
text = '!!!'
return super().insert_text(text, from_undo=from_undo)
from kivy.lang import Builder
from kivy.base import runTouchApp
root = Builder.load_string('''
BoxLayout:
orientation: 'vertical'
CheckBox:
color: r.value, g.value, b.value, a.value
Slider:
import kivy
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
import socket