Skip to content

Instantly share code, notes, and snippets.

View Mr-Coxall's full-sized avatar

Patrick Coxall Mr-Coxall

  • St. Mother Teresa HS
  • Ottawa
View GitHub Profile
@Mr-Coxall
Mr-Coxall / FileTransfer.py
Created August 31, 2016 01:07 — forked from omz/FileTransfer.py
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@Mr-Coxall
Mr-Coxall / area_and_perimeter.py
Last active July 1, 2018 02:32
area_and_perimeter.py
# Created by: Mr. Coxall
# Created on: Sep 2018
# Created for: ICS3U
# This program calculates the area and perimter of a rectangle
import ui
def answer_touch_up_inside(sender):
# displays the answer for area and perimeter
view['area_answer_label'].text = 'Area = ' + str(3*5) + ' cm^2'
@Mr-Coxall
Mr-Coxall / mascot.py
Last active July 1, 2018 02:42
mascot.pdf
# Created by: Mr. Coxall
# Created on: Aug 2018
# Created for: ICS3U
# This program displays the school name and their mascot
import ui
def mother_teresa_touch_up_inside(sender):
# displays the school and mascot for MT
view['school_name_label'].text = 'Mother Teresa HS'
@Mr-Coxall
Mr-Coxall / images.py
Created September 3, 2016 02:29
sprites
# Created by: Mr. Coxall
# Created on: Aug 2016
# Created for: ICS3U
# This program shows images
import ui
# first get a reference to the image you saved in your Python folder
my_pic = ui.Image.named('sprites/MT_crest.jpg')
@Mr-Coxall
Mr-Coxall / area_and_perimeter_ver2.py
Last active July 1, 2018 02:45
area_and_perimeter_ver2.py
# Created by: Mr. Coxall
# Created on: Aug 2018
# Created for: ICS3U
# This program displays area and perimeter of a rectangle,
# but this time the user can enter different lengths and widths
import ui
def calculate_button_touch_up_inside(sender):
# calculate area and perimeter
@Mr-Coxall
Mr-Coxall / global_variables.py
Created September 4, 2016 02:42
global_variables.py
# Created by: Mr. Coxall
# Created on: Sep 2016
# Created for: ICS3U
# This program shows the difference between local and global variables
import ui
variableX = 25
def local_button_touch_up_inside(sender):
@Mr-Coxall
Mr-Coxall / card_scene.py
Created September 10, 2016 13:13
card_scene.py
# for use with https://github.com/omz/PythonistaAppTemplate
from scene import *
import ui
from menu_scene import *
class CardBackScene(Scene):
def __init__(self, card_back_color='blue'):
Scene.__init__(self)
@Mr-Coxall
Mr-Coxall / github_downloader.py
Last active January 10, 2017 05:29
github_downloader.py
# Created by: jsbain
# Created on: Aug 2014
# URL : https://github.com/jsbain/GitHubGet/blob/master/GitHubGet.py
# download an entire github repo.
# either copy the url to clipboard, and run script, or run following bookmarklet.
# will unzip to repo-branch (so be careful if downloading same branch name from multiple users)
#
## javascript:(function()%7Bif(document.location.href.indexOf('http')===0)document.location.href='pythonista://GitHubGet?action=run&argv='+document.location.href;%7D)();
@Mr-Coxall
Mr-Coxall / address_with_button.py
Last active July 1, 2018 02:23
address_with_button.py
# Created by: Mr. Coxall
# Created on: Aug 2018
# Created for: ICS3U
# This program is the Address progran, but with a button
import ui
def show_address_touch_up_inside(sender):
#print ('Hello, World!')
view['name_label'].text = ("Mr. Coxall")
@Mr-Coxall
Mr-Coxall / images.py
Last active July 1, 2018 02:44
images.pyui
# Created by: Mr. Coxall
# Created on: Aug 2018
# Created for: ICS3U
# This program shows images
import ui
# first get a reference to the image you saved in your Python folder
my_pic = ui.Image.named('./sprites/MT_crest.jpg')