This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# comment | |
import ui | |
my_pic = ui.Image.named('./sprites/MT_crest.jpg') | |
my_image = ui.ImageView(frame=(1024, 0,100,150)) | |
my_image.image = my_pic | |
view = ui.load_view() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Mr. Coxall | |
# Created on: Sep 2016 | |
# Created for: ICS3U | |
# This program shows how to use an if statement | |
import ui | |
MAX_NUMBER_OF_STUDENTS = 24 | |
def check_number_of_students_touch_up_inside(sender): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for use with https://github.com/omz/PythonistaAppTemplate | |
from scene import * | |
import ui | |
import time | |
class FirstScene(Scene): | |
def setup(self): | |
# get starting time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for use with https://github.com/omz/PythonistaAppTemplate | |
from scene import * | |
import ui | |
import time | |
class FirstScene(Scene): | |
def setup(self): | |
# get starting time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Mr. Coxall | |
# Created on: Sep 2016 | |
# Created for: ICS3U | |
# This program shows how to use an if statement | |
import ui | |
MAX_NUMBER_OF_STUDENTS = 24 | |
def check_number_of_students_touch_up_inside(sender): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Mr. Coxall | |
# Created on: Sep 2016 | |
# Created for: ICS3U | |
# This program shows how to use an if statement | |
import ui | |
from numpy import random | |
# random number to guess | |
number_to_guess = random.randint(1, 10) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Mr. Coxall | |
# Created on: Aug 2016 | |
# 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_area(length_sent, width_sent): | |
# calculate area |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Created by: Mr. Coxall | |
# Created on: Aug 2016 | |
# Created for: ICS3U | |
# This program shows optional and named parameters | |
def print_name(first, initial = '', last = ''): | |
# print name | |
if initial == '': | |
print(first + ' ' + last) | |
else: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import ui | |
import os | |
from objc_util import ObjCInstance, ObjCClass | |
from operator import attrgetter | |
import time | |
import threading | |
import functools | |
import ftplib | |
import re |