Skip to content

Instantly share code, notes, and snippets.

#! python3
# coding: utf-8
import arrow
class CurrentDate():
def __init__(self, tzinfo=None):
self.tzinfo = tzinfo
def _formatter(self, fmt):
@halspg
halspg / ui_slide_menu.py
Last active August 8, 2023 14:36
Pythonista UI: hamburger menu test
#! python3
# coding: utf-8
import ui
import faker
import functools
w, h = ui.get_screen_size()
menu_w, menu_h = (150, 300)
default_frame = (w, 0, menu_w, menu_h)
@halspg
halspg / Pythonista_uiView_will_close.py
Created February 6, 2023 10:40
When present("sheet"), will_close() is not called when the view is closed by swiping down.
# When present("sheet"), will_close() is not called when the view is closed by swiping down.
import ui
import dialogs
class test(ui.View):
def will_close(self):
print("View closed.")
style = ["fullscreen", "sheet", "popover", "panel"]
@halspg
halspg / SliderWithLabel_danrcook.py
Last active February 17, 2023 13:17
An application that searches music with the iTunes API.
# https://gist.github.com/danrcook/5b35e47628d28daec1d5ec7e909b4f95
# original: https://github.com/tdamdouni/Pythonista/blob/master/slider/SliderWithLabel_danrcook.py
'''
SliderWithLabel is a wrapper for ui.Slider() for use in Pythonista on iOS. Provides an editable label for the display and setting of the slider value.
See SliderWithLabel class for detailed usage.
'''
__author__ = '@cook'
@halspg
halspg / gist20120305-1843.txt
Created March 5, 2012 09:43
Temporary description
http://www.amazon.co.jp/gp/aw/s/ref=is_box_?__mk_ja_JP=%83J%83%5E%83J%83i&k=_QS_