anonymous No title
No License Python
2021年09月03日
Copy Clone
# coding: utf-8

from __future__ import division
import ui
import clipboard
from console import hud_alert

shows_result = False

def button_tapped(sender):
	'@type sender: ui.Button'
	# Get the button's title for the following logic:
	t = sender.title
	global shows_result
	# Get the labels:
	label = sender.superview['label1']
	label2 = sender.superview['label2']
	if t in '0123456789':
		if shows_result or label.text == '0':
			# Replace 0 or last result with number:
			label.text = t
		else:
			# Append number:
			label.text += t
	elif t == '.' and label.text[-1] != '.':
		# Append decimal point (if not already there)
		label.text += t
	elif t in '+-÷×':
		if label.text[-1] in '+-÷×':
			# Replace current operator
			label.text = label.text[:-1] + t
		else:
			# Append operator
			label.text += t
	elif t == 'AC':
		# Clear All
		label.text = '0'
	elif t == 'C':
		# Delete the last character:
		label.text = label.text[:-1]
		if len(label.text) == 0:
			label.text = '0'
	elif t == '=':
		# Evaluate the result:
		try:
			label2.text = label.text + ' ='
			expr = label.text.replace('÷', '/').replace('×', '*')
			label.text = str(eval(expr))
		except (SyntaxError, ZeroDivisionError):
			label.text = 'ERROR'
		shows_result = True
	if t != '=':
		shows_result = False
		label2.text = ''

def copy_action(sender):
	'@type sender: ui.Button'
	t1 = sender.superview['label1'].text
	t2 = sender.superview['label2'].text
	if t2:
		text = t2 + ' ' + t1
	else:
		text = t1
	clipboard.set(text)
	hud_alert('Copied')

v = ui.load_view('Calculator')

if min(ui.get_screen_size()) >= 768:
	# iPad
	v.frame = (0, 0, 360, 400)
	v.present('sheet')
else:
	# iPhone
	v.present(orientations=['portrait'])
# coding: utf-8

from __future__ import division
import ui
import clipboard
from console import hud_alert

shows_result = False

def button_tapped(sender):
	'@type sender: ui.Button'
	# Get the button's title for the following logic:
	t = sender.title
	global shows_result
	# Get the labels:
	label = sender.superview['label1']
	label2 = sender.superview['label2']
	if t in '0123456789':
		if shows_result or label.text == '0':
			# Replace 0 or last result with number:
			label.text = t
		else:
			# Append number:
			label.text += t
	elif t == '.' and label.text[-1] != '.':
		# Append decimal point (if not already there)
		label.text += t
	elif t in '+-÷×':
		if label.text[-1] in '+-÷×':
			# Replace current operator
			label.text = label.text[:-1] + t
		else:
			# Append operator
			label.text += t
	elif t == 'AC':
		# Clear All
		label.text = '0'
	elif t == 'C':
		# Delete the last character:
		label.text = label.text[:-1]
		if len(label.text) == 0:
			label.text = '0'
	elif t == '=':
		# Evaluate the result:
		try:
			label2.text = label.text + ' ='
			expr = label.text.replace('÷', '/').replace('×', '*')
			label.text = str(eval(expr))
		except (SyntaxError, ZeroDivisionError):
			label.text = 'ERROR'
		shows_result = True
	if t != '=':
		shows_result = False
		label2.text = ''

def copy_action(sender):
	'@type sender: ui.Button'
	t1 = sender.superview['label1'].text
	t2 = sender.superview['label2'].text
	if t2:
		text = t2 + ' ' + t1
	else:
		text = t1
	clipboard.set(text)
	hud_alert('Copied')

v = ui.load_view('Calculator')

if min(ui.get_screen_size()) >= 768:
	# iPad
	v.frame = (0, 0, 360, 400)
	v.present('sheet')
else:
	# iPhone
	v.present(orientations=['portrait'])
anonymous
Anonymous
2021年09月05日
“I haven’t seen you in these parts,” the barkeep said, sidling over to where I sat. “Personage’s Bao.” He stated it exuberantly, as if say of his exploits were shared by means of settlers hither assorted a fire in Aeternum. He waved to a expressionless tun upset us, and I returned his gesticulate with a nod. He filled a glass and slid it to me across the stained red wood of the bar in the vanguard continuing. “As a betting fellow, I’d be willing to wager a above-board portion of coin you’re in Ebonscale Reach for more than the swig and sights,” he said, eyes glancing from the sword sheathed on my hip to the bend slung across my back. https://images.google.je/url?q=https://renewworld.ru/
anonymous
Anonymous
2021年09月06日
“I haven’t seen you in these parts,” the barkeep said, sidling over and above to where I sat. “Designation’s Bao.” He stated it exuberantly, as if solemn word of honour of his exploits were shared aside settlers around multitudinous a firing in Aeternum. He waved to a unimpassioned hogshead hard by us, and I returned his indication with a nod. He filled a eyeglasses and slid it to me across the stained red wood of the court before continuing. “As a betting houseman, I’d be ready to wager a above-board portion of invent you’re in Ebonscale Reach on the side of more than the swig and sights,” he said, eyes glancing from the sword sheathed on my hip to the salaam slung across my back. https://www.google.sn/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&cad=rja&uact=8&ved=0CAcQjRw&url=https://renewworld.ru/otlichie-new-world-versii-deluxe-i-standart-edition/
Output