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
<?xml version="1.0" encoding="UTF-8"?> | |
<module type="PYTHON_MODULE" version="4"> | |
<component name="NewModuleRootManager"> | |
<content url="file://$MODULE_DIR$" /> | |
<orderEntry type="inheritedJdk" /> | |
<orderEntry type="sourceFolder" forTests="false" /> | |
</component> | |
<component name="TestRunnerService"> | |
<option name="PROJECT_TEST_RUNNER" value="Unittests" /> | |
</component> |
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
#import libraries | |
#Uses http://stackoverflow.com/questions/13215215/python-tkinter-animation | |
import tkinter | |
#Set width, height, frames per second and how long to cross | |
CANVAS_WIDTH = 800 | |
CANVAS_HEIGHT = 600 | |
FPS = 120 | |
SECONDS_TO_CROSS = 1.5 |
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
oopics4uunit2 |
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
import pickle #used to serialize the data | |
import os.path | |
#Comment this code | |
#global variables | |
songs_and_bands = {"Drive": "Judge Jackson"} | |
def open_file(): | |
global songs_and_bands #get global variable | |
if os.path.isfile('songs_and_bands.dat'): | |
binary_file=open('songs_and_bands.dat','rb') |
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
def output_variables(): | |
print("w:", w, "Type:", type(w)) | |
print("x:", x, "Type:", type(x)) | |
print("y:", y, "Type:", type(y)) | |
print("z:", z, "Type:", type(z)) | |
w = 3.2 | |
x = 3.8 | |
y = -3.2 | |
z = -3.8 |
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
#I McTavish | |
#Sept 21, 2016 | |
#Variables - demonstrate variables | |
#Declare an integer variable | |
my_age = 17 | |
#output my_age | |
print(my_age) | |
#output type of data | |
print(type(my_age)) |
NewerOlder