Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ascii Art Picker for Pythonista for iOS
# coding: utf-8
import ui
import clipboard
from console import hud_alert
aa_list = ["٩( 'ω' )و",
'₍₍⁽⁽(ી(◔‿ゝ◔)ʃ)₎₎⁾⁾',
'(◔‸◔ )',
'☝( ◠‿◠ )☝',
'( ・ワ・)',
'(◞‸◟)',
'_(:3 」∠)_',
]
def button_tapped(sender):
'@type sender: ui.Button'
clipboard.set(sender.title)
hud_alert('Copied')
view = ui.load_view('AAPickerUI')
view.present('sheet')
for i, aa in enumerate(aa_list):
view['button{0:d}'.format(i+1)].title = aa
[{"class":"View","attributes":{"background_color":"RGBA(1.000000,1.000000,1.000000,1.000000)","tint_color":"RGBA(0.000000,0.478000,1.000000,1.000000)","enabled":true,"border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","flex":""},"frame":"{{0, 0}, {320, 504}}","nodes":[{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button1","uuid":"0AD0F71F-693D-460E-B1B9-2DDE87217FA0","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{0, 0}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button2","uuid":"B71C30EA-35DB-41CE-87D3-FFAE31CE1EEF","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{107, 0}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button3","uuid":"B262047B-1612-4CDF-A195-2D47C4AAAEF5","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{214, 0}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button4","uuid":"8128643A-B0CB-4671-9DFB-054A3CAB6920","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{0, 58}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button5","uuid":"AB579E23-4A3E-4F8A-A8E7-05703292ADCF","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{107, 58}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button6","uuid":"A6ADA5F8-BA0E-4900-8C10-A03F70012D90","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{214, 58}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button7","uuid":"CF0B4D8A-AD31-474A-9FF1-237FF62EF09C","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{0, 116}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button8","uuid":"471DB699-091D-44D3-BDFD-ED993E39BFFA","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{107, 116}, {106, 50}}","nodes":[]},{"class":"Button","attributes":{"font_size":15,"enabled":true,"flex":"","font_bold":false,"name":"button9","uuid":"612592AA-6AFA-450C-9E14-06BE6C54917F","border_color":"RGBA(0.000000,0.000000,0.000000,1.000000)","action":"button_tapped","title":"Button"},"frame":"{{214, 116}, {106, 50}}","nodes":[]}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.