From aa8ca08bf7f554fb5a21fd00d92e55a15015f39f Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Sat, 30 Sep 2017 20:40:20 -0700 Subject: [PATCH 01/11] Update screens.py --- screens.py | 61 +++++++++++++++++++++--------------------------------- 1 file changed, 24 insertions(+), 37 deletions(-) diff --git a/screens.py b/screens.py index d544cbe..b78d813 100644 --- a/screens.py +++ b/screens.py @@ -7,6 +7,15 @@ def __init__(self, i, text, func): self.screen_func = func class Screens(Window): + def new_lesson(self, screenNum): + screenNum -= 1 + self.new() + self.cenLbl(self.s[screenNum].text) + if screenNum > 1: + prevBtn(self.s[screenNum-1].func) + if nextScn < len(self.s)-1: + nextBtn(self.s[screenNum+1].func) + def __init__(self, master=None): super(Screens, self).__init__(master) self.master = master @@ -31,68 +40,48 @@ def s_init(self): self.cenBtn(s.text, s.screen_func) def idle(self): - self.new() - self.cenLbl(self.s[0].text) + self.new_lesson(1) self.multiLbl("Hello, and welcome to LearnPythonWithPython. Today we will be learning about how to set up the IDE called IDLE but ... come to think about it, you are viewing this application so you probably already have IDLE installed. See you later.") - self.btnNext(self.syn) def syn(self): - self.new() - self.cenLbl(self.s[1].text) + self.new_lesson(2) self.multiLbl("Congratulations! You've completed lesson 1. This is lesson 2. To see the basic syntax, look at the source code for this application.") - self.btnPrev(self.idle) - self.btnNext(self.var) def var(self): - self.new() - self.cenLbl(self.s[2].text) + self.new_lesson(3) self.multiLbl("Just like literally every single coding language in the world (except for maybe like BASIC and Assembly) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!") - self.btnPrev(self.syn) - self.btnNext(self.data_types) def data_types(self): - self.new() - self.cenLbl(self.s[3].text) + self.new_lesson(4) self.multiLbl("As I said last lesson, variables can be mmmmmmaaaaaannnnnnyyyyyy different types of things. A variable can be an str which is an str-ing of text surrounded by quotes (e.g. \"Hello, world!\"), an int which is an int-eger (e.g. 42), a float which is a float-ing point number (e.g. 3.14159265358979323846264338327950288419716939937510), a boolean which is a boolean value (which is either True or False. I think it's False. Wait nevermind it's true.), an array which stores an array of values surrounded in brackets where all the values are seperated by ,s (e.g. [\"Why?\", \"Are we stronger than the elements?\", \"What's yellow and dangerous?\", \"What do you get when you multiply six by seven?\", \"How many Vogons does it take to change a lightbulb?\", \"How many roads must a man walk down?\", 42, True, [\"Waaaait... an array inside an array?\", \"that's cray-cray\"], \"Is the array done yet?\", False,...] you get the idea.), a dictionary which is basically a dictionary for variables (e.g. ages = {\"Bob\": 100, \"Me\": 11}) and sooooo on and soooo forth") - self.btnPrev(self.var) - self.btnNext(self.hello_world) def hello_world(self): - self.new() - self.cenLbl(self.s[4].text) + self.new_lesson(5) self.multiLbl("Hello world programs are usually the first to be learned because they are so simple, but why do they make them so simple? Those programs could be made harder and more fun by just a little bit. First things first, you need to know what a hello world program looks like, so look in the console. Go on. I'm not going anywhere. You want to be able to do that? Well, that sucks for you. This lesson is not about hello world. It's about the base methods in Python. \"What's a method?\" I hear you typing in the comments. Well, I'm not telling you. And also I don't read the comments. So sucks for you.\nSo any ways, there are many base methods >:(don't even try asking):< such as print and input. Print prints text to the console. Input asks the user for input. That simple. Well not really. In print you have to put () after it because it's a *method* and inside those parentheses put what you want to say (HAS TO BE AN STR (can be a variable)), for example print(\"LearnPythonWithPython\") will print LearnPythonWithPython. Seriously. Try it. PRESS LE BUTTON!!!") self.cenBtn("print(\"LearnPythonWithPython\")", self.hello_world_code) self.cenLbl("It's time for CHALLENGE TIME: Try to make a hello world program by declaring a variable called string and print()ing it") - self.btnPrev(self.data_types) - self.btnNext(self.inp) def inp(self): - self.new() - self.cenLbl(self.s[5].text) + self.new_lesson(6) self.multiLbl("Hello, world! That last (mini) project was fun...ish. We want to make programs with UI! We want user input() ... i mean interface lol lmao rofl lellellellellelelelelelllelleleellelelelellelelel. so user \"interface\" as they call it is an interface where users interact. Hey! There's another possible name! User Interaction stuf! well anyways, let's get to the point. The input() method is a good starting point for UI. It allows the user to enter ... wait for it ... input()! Inside the parentheses thingies, you have to type in what ever you want the computer to ask you. For instance, press the button that has a line of code on it.") self.cenBtn("inp = input(\"Enter your input here: \")\nprint(inp)", self.inp_code) self.cenLbl("Now you try to figure out a practical purpose for the input() method. Enter it in the comments (that I tooooootally read)") - self.btnPrev(self.hello_world) - self.btnNext(self.if_statement) def if_statement(self): - self.new() - self.cenLbl(self.s[6].text) + self.new_lesson(7) self.multiLbl("If statements determine *if* a condition (e.g. 1>2 is False and \"hello\" == \"hello\" is True) is True, then it does the stuff indented after the colon(:). One example is") - btnTxt = """if True: - \tprint(\"Yay! It's True!\") + btnTxt = """ + if True: + \tprint("if True: \n\t\"is always evaluated\"") if False: - \tprint(\":( It's False") + \tprint("if False: \n\t\"is never evaluated\"") """ self.cenBtn(btnText, self.if_code) - self.btnPrev(self.inp) - self.btnNext(self.else_elif) def else_elif(self): - self.new() + self.new_lesson(8) self.cenLbl(self.s[7].text) - self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... else. You just type else: and then whatever the **** you want if it is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.") - self.btnPrev(self.if_statement) + self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! LOOK AT THE TITLE!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... you guessed it — else. You just type else: and then whatever the print(\"****\") you want if the condition you tested is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.") def hello_world_code(self): print("LearnPythonWithPython") @@ -103,8 +92,6 @@ def inp_code(self): def if_code(self): if True: - print("Yay! It's True!") + print("if True: \n\t\"is always evaluated\"") if False: - print(":( It's False.") - - + print("if False: \n\t\"is never evaluated\"") From 4eff57f391d69b6f19693f2956b2f5d38b672ec7 Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Mon, 2 Oct 2017 07:13:39 -0700 Subject: [PATCH 02/11] Update screens.py --- screens.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/screens.py b/screens.py index b78d813..8d40880 100644 --- a/screens.py +++ b/screens.py @@ -2,16 +2,31 @@ from window import Window class Screen: - def __init__(self, i, text, func): - self.text = "Lesson "+i+": "+text - self.screen_func = func + def __init__(self, title, showAs, func): + self.title = title + self.showAs = showAs + self.screenFunc = func + +class LessonScreen: + def __init__(self, i, text, screenFunc): + title = "Lesson "+str(i)+": "+text + showAs = title + func = screenFunc + super(LessonScreen, self).__init__(title, showAs, func) + +class ProjectScreen: + def __init__(self, unit, proj, partTitle, screenFunc): + text = "Unit "+str(unit)+" - "+proj+": "+partTitle + showAs = partTitle + func = screenFunc + super(ProjectScreen, self).__init(title, showAs, func) class Screens(Window): def new_lesson(self, screenNum): screenNum -= 1 self.new() self.cenLbl(self.s[screenNum].text) - if screenNum > 1: + if screenNum > 0: prevBtn(self.s[screenNum-1].func) if nextScn < len(self.s)-1: nextBtn(self.s[screenNum+1].func) @@ -28,12 +43,16 @@ def __init__(self, master=None): Screen(4, "Data types", self.data_types), Screen(5, "Hello, world!", self.hello_world), Screen(6, "Input", self.inp), - Screen(7, "If statements", self.if_statement) + Screen(7, "If statements", self.if_statement), Screen(8, "Else and elif statements", self.else_elif) ] - def s_init(self): + def s_init(self, unitNum): self.new(home=True) + s = "self.unit_"+str(unitNum)+"()" + exec(s) + + def unit_1(self) for i in range(len(self.screens)): s = self.s[i] ind = i+1 From b92d2744d1e28340b41735f171409983d0a5cfec Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Mon, 2 Oct 2017 07:50:50 -0700 Subject: [PATCH 03/11] Clean up Screen.py --- screens.py | 50 ++++++++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/screens.py b/screens.py index 8d40880..bbb7523 100644 --- a/screens.py +++ b/screens.py @@ -22,21 +22,23 @@ def __init__(self, unit, proj, partTitle, screenFunc): super(ProjectScreen, self).__init(title, showAs, func) class Screens(Window): - def new_lesson(self, screenNum): + def new_lesson(self, unit, screenNum): screenNum -= 1 + unitStr = "self.u"+str(unit) + u = exec(unitStr) self.new() - self.cenLbl(self.s[screenNum].text) + self.cenLbl(u[screenNum].text) if screenNum > 0: - prevBtn(self.s[screenNum-1].func) - if nextScn < len(self.s)-1: - nextBtn(self.s[screenNum+1].func) + prevBtn(u[screenNum-1].func) + if screenNum < len(u)-1: + nextBtn(u[screenNum+1].func) def __init__(self, master=None): super(Screens, self).__init__(master) self.master = master self.master.title("LearnPythonWithPython") self.pack(fill=BOTH, expand=1) - self.s = [ + self.u1 = [ Screen(1, "Setting up the IDE", self.idle), Screen(2, "Basic syntax", self.syn), Screen(3, "Variables", self.var), @@ -54,9 +56,8 @@ def s_init(self, unitNum): def unit_1(self) for i in range(len(self.screens)): - s = self.s[i] - ind = i+1 - self.cenBtn(s.text, s.screen_func) + s = self.u1[i] + self.cenBtn(s.title, s.func) def idle(self): self.new_lesson(1) @@ -77,40 +78,37 @@ def data_types(self): def hello_world(self): self.new_lesson(5) self.multiLbl("Hello world programs are usually the first to be learned because they are so simple, but why do they make them so simple? Those programs could be made harder and more fun by just a little bit. First things first, you need to know what a hello world program looks like, so look in the console. Go on. I'm not going anywhere. You want to be able to do that? Well, that sucks for you. This lesson is not about hello world. It's about the base methods in Python. \"What's a method?\" I hear you typing in the comments. Well, I'm not telling you. And also I don't read the comments. So sucks for you.\nSo any ways, there are many base methods >:(don't even try asking):< such as print and input. Print prints text to the console. Input asks the user for input. That simple. Well not really. In print you have to put () after it because it's a *method* and inside those parentheses put what you want to say (HAS TO BE AN STR (can be a variable)), for example print(\"LearnPythonWithPython\") will print LearnPythonWithPython. Seriously. Try it. PRESS LE BUTTON!!!") - self.cenBtn("print(\"LearnPythonWithPython\")", self.hello_world_code) + code = """ + print("LearnPythonWithPython") + """ + self.cenBtn(code, lambda: self.run(code)) self.cenLbl("It's time for CHALLENGE TIME: Try to make a hello world program by declaring a variable called string and print()ing it") def inp(self): self.new_lesson(6) self.multiLbl("Hello, world! That last (mini) project was fun...ish. We want to make programs with UI! We want user input() ... i mean interface lol lmao rofl lellellellellelelelelelllelleleellelelelellelelel. so user \"interface\" as they call it is an interface where users interact. Hey! There's another possible name! User Interaction stuf! well anyways, let's get to the point. The input() method is a good starting point for UI. It allows the user to enter ... wait for it ... input()! Inside the parentheses thingies, you have to type in what ever you want the computer to ask you. For instance, press the button that has a line of code on it.") - self.cenBtn("inp = input(\"Enter your input here: \")\nprint(inp)", self.inp_code) + code = """ + inp = input("Enter your input here: ") + print(inp) + """ + self.cenBtn(code, self.run(code) self.cenLbl("Now you try to figure out a practical purpose for the input() method. Enter it in the comments (that I tooooootally read)") def if_statement(self): self.new_lesson(7) self.multiLbl("If statements determine *if* a condition (e.g. 1>2 is False and \"hello\" == \"hello\" is True) is True, then it does the stuff indented after the colon(:). One example is") - btnTxt = """ + code = """ if True: \tprint("if True: \n\t\"is always evaluated\"") if False: \tprint("if False: \n\t\"is never evaluated\"") """ - self.cenBtn(btnText, self.if_code) - + self.cenBtn(btnText, lambda: self.run(code)) + def else_elif(self): self.new_lesson(8) self.cenLbl(self.s[7].text) self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! LOOK AT THE TITLE!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... you guessed it — else. You just type else: and then whatever the print(\"****\") you want if the condition you tested is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.") - - def hello_world_code(self): - print("LearnPythonWithPython") - def inp_code(self): - inp = input("Enter your input here: ") - print(inp) - - def if_code(self): - if True: - print("if True: \n\t\"is always evaluated\"") - if False: - print("if False: \n\t\"is never evaluated\"") + def run(self, code): + exec(code) From b5932e8009f415ec806639851c9564c68c8bdf5b Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Mon, 2 Oct 2017 09:06:33 -0700 Subject: [PATCH 04/11] Update screens.py --- screens.py | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/screens.py b/screens.py index bbb7523..a0e48da 100644 --- a/screens.py +++ b/screens.py @@ -22,10 +22,13 @@ def __init__(self, unit, proj, partTitle, screenFunc): super(ProjectScreen, self).__init(title, showAs, func) class Screens(Window): + homeBounds = "800x1000" + screenBounds = "800x400" + def new_lesson(self, unit, screenNum): screenNum -= 1 - unitStr = "self.u"+str(unit) - u = exec(unitStr) + unitStr = "self.u"+str(unit) + u = exec(unitStr) self.new() self.cenLbl(u[screenNum].text) if screenNum > 0: @@ -46,18 +49,24 @@ def __init__(self, master=None): Screen(5, "Hello, world!", self.hello_world), Screen(6, "Input", self.inp), Screen(7, "If statements", self.if_statement), - Screen(8, "Else and elif statements", self.else_elif) + Screen(8, "Else and elif statements", self.else_elif), + Screen(9, "\"WHAT THE HECK IS A METHOD!?!?!?\" (your comments)", self.methods) ] - + def s_init(self, unitNum): self.new(home=True) - s = "self.unit_"+str(unitNum)+"()" + s = "self.unit_"+str(unitNum)+"()" exec(s) - - def unit_1(self) + self.master.geometry(self.homeBounds) + + def unit_1(self): for i in range(len(self.screens)): s = self.u1[i] - self.cenBtn(s.title, s.func) + self.cenBtn(s.showAs, lambda: self.goTo(s.func)) + + def goTo(self, func): + self.master.geometry(screenBounds) + func() def idle(self): self.new_lesson(1) @@ -70,8 +79,8 @@ def syn(self): def var(self): self.new_lesson(3) self.multiLbl("Just like literally every single coding language in the world (except for maybe like BASIC and Assembly) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!") - - def data_types(self): + + def data_types(self): self.new_lesson(4) self.multiLbl("As I said last lesson, variables can be mmmmmmaaaaaannnnnnyyyyyy different types of things. A variable can be an str which is an str-ing of text surrounded by quotes (e.g. \"Hello, world!\"), an int which is an int-eger (e.g. 42), a float which is a float-ing point number (e.g. 3.14159265358979323846264338327950288419716939937510), a boolean which is a boolean value (which is either True or False. I think it's False. Wait nevermind it's true.), an array which stores an array of values surrounded in brackets where all the values are seperated by ,s (e.g. [\"Why?\", \"Are we stronger than the elements?\", \"What's yellow and dangerous?\", \"What do you get when you multiply six by seven?\", \"How many Vogons does it take to change a lightbulb?\", \"How many roads must a man walk down?\", 42, True, [\"Waaaait... an array inside an array?\", \"that's cray-cray\"], \"Is the array done yet?\", False,...] you get the idea.), a dictionary which is basically a dictionary for variables (e.g. ages = {\"Bob\": 100, \"Me\": 11}) and sooooo on and soooo forth") @@ -81,9 +90,9 @@ def hello_world(self): code = """ print("LearnPythonWithPython") """ - self.cenBtn(code, lambda: self.run(code)) + self.cenBtn(code, lambda: exec(code)) self.cenLbl("It's time for CHALLENGE TIME: Try to make a hello world program by declaring a variable called string and print()ing it") - + def inp(self): self.new_lesson(6) self.multiLbl("Hello, world! That last (mini) project was fun...ish. We want to make programs with UI! We want user input() ... i mean interface lol lmao rofl lellellellellelelelelelllelleleellelelelellelelel. so user \"interface\" as they call it is an interface where users interact. Hey! There's another possible name! User Interaction stuf! well anyways, let's get to the point. The input() method is a good starting point for UI. It allows the user to enter ... wait for it ... input()! Inside the parentheses thingies, you have to type in what ever you want the computer to ask you. For instance, press the button that has a line of code on it.") @@ -91,9 +100,9 @@ def inp(self): inp = input("Enter your input here: ") print(inp) """ - self.cenBtn(code, self.run(code) + self.cenBtn(code, lambda: exec(code)) self.cenLbl("Now you try to figure out a practical purpose for the input() method. Enter it in the comments (that I tooooootally read)") - + def if_statement(self): self.new_lesson(7) self.multiLbl("If statements determine *if* a condition (e.g. 1>2 is False and \"hello\" == \"hello\" is True) is True, then it does the stuff indented after the colon(:). One example is") @@ -103,12 +112,18 @@ def if_statement(self): if False: \tprint("if False: \n\t\"is never evaluated\"") """ - self.cenBtn(btnText, lambda: self.run(code)) + self.cenBtn(btnText, lambda: exec(code)) def else_elif(self): self.new_lesson(8) - self.cenLbl(self.s[7].text) self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! LOOK AT THE TITLE!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... you guessed it — else. You just type else: and then whatever the print(\"****\") you want if the condition you tested is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.") - def run(self, code): - exec(code) + def methods(self): + self.new_lesson(9) + self.multiLbl("Now, we're finally going to answer that question: \"WHAT THE HECK IS A METHOD?!?!?!?!?!?!?!?!?!\" Geez. Stop commenting. ITS BAD 4 UR PUNCSHOOASHUN CUPZ LOC KEE AN SPELEENG. IT WILL TURN THE SQL DATABASE THAT I DON'T READ INTO A YOUTUBE COMMENTS! I LITTERALLY MAKE THE WORDS UR COMMENT HAS BEEN RECIEVED APPEAR EVEN IF I NEVER READ IT!!! SHOOT MY CUZ LUC KEE IZ BROCEN I M USING A MAC ALL MY TEXT IS NOW AND FOREVER CAPITALIZED :(:(:(:(:(:(:(") + self.multiLbl("SO, ANYWAYS, A METHOD IS A FUNCTION INSIDE OF A CLASS. \"WHAT ARE FUNCTIONS AND CLASSES?\" YOU WILL FIND OUT NEXT LESSON.") + + def functions(self): + self.new_lesson(10) + self.multiLbl("A function. Use def function_name:\n\t#insert_code_here to create a function and function_name() to call it.") + From f48202e7b4e30a50c4209784618d4ac5f40c9456 Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Tue, 3 Oct 2017 17:42:51 -0700 Subject: [PATCH 05/11] Update setup.py --- appinst/setup.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/appinst/setup.py b/appinst/setup.py index 389c959..80d36f6 100644 --- a/appinst/setup.py +++ b/appinst/setup.py @@ -3,11 +3,8 @@ import windows, screen setup( - options = {'py2exe': {'bundle_files': 1}} - zipFile = None windows = [{ - "script": "mainloop", - "icon_resources": [(1, "pycon-icon.ico")] + "script": "mainloop.py", "dest_base": "LearnPythonWithPython" }] ) From 06cd6df7dbcb6017b37ee7f28ea2d4e7bc5c1c86 Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Tue, 3 Oct 2017 17:49:20 -0700 Subject: [PATCH 06/11] Update setup_exe.py --- appinst/{setup.py => setup_exe.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appinst/{setup.py => setup_exe.py} (100%) diff --git a/appinst/setup.py b/appinst/setup_exe.py similarity index 100% rename from appinst/setup.py rename to appinst/setup_exe.py From 5760029243ae41017dd6ab421cb6300a735d74a7 Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Tue, 3 Oct 2017 17:49:37 -0700 Subject: [PATCH 07/11] Rename appinst/setup_exe.py to setup_exe.py --- appinst/setup_exe.py => setup_exe.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename appinst/setup_exe.py => setup_exe.py (100%) diff --git a/appinst/setup_exe.py b/setup_exe.py similarity index 100% rename from appinst/setup_exe.py rename to setup_exe.py From f2be70712e50a27b1a5ae310c490ca55549cd127 Mon Sep 17 00:00:00 2001 From: Belvedere Tiburon Library CoderDojo Date: Fri, 6 Oct 2017 18:06:41 -0700 Subject: [PATCH 08/11] update files --- __pycache__/mainloop.cpython-34.pyc | Bin 0 -> 277 bytes __pycache__/screens.cpython-34.pyc | Bin 0 -> 12005 bytes __pycache__/window.cpython-34.pyc | Bin 0 -> 2798 bytes dist/LearnPythonWithPython.exe | Bin 0 -> 23552 bytes screens.py | 104 ++++++++++++++-------------- setup_exe.py | 7 +- window.py | 14 ++-- 7 files changed, 62 insertions(+), 63 deletions(-) create mode 100644 __pycache__/mainloop.cpython-34.pyc create mode 100644 __pycache__/screens.cpython-34.pyc create mode 100644 __pycache__/window.cpython-34.pyc create mode 100644 dist/LearnPythonWithPython.exe diff --git a/__pycache__/mainloop.cpython-34.pyc b/__pycache__/mainloop.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..69f2dc3d59ef1a3509a45b21851d9e4e507ad75e GIT binary patch literal 277 zcmX|5!AiqG5Ph?oX47i1ApMA3BnZ8U_yu0##k~c0k+#_+>_)KXe2n-Bb9e$of34YE_?A36H#f|IDOKWeF PNmwwfXeH*fqzn25E*3la literal 0 HcmV?d00001 diff --git a/__pycache__/screens.cpython-34.pyc b/__pycache__/screens.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ca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7sN_jztZWw*C;*&T&)LFJ!-P65T8Xtpv>|)pKBEPTJc8cp9 zq@JnW5_J>bF=W>jR>02X-0!gV5-?^@Fyu*bM+mQHxAW!fR(>CIuPzM#bx%sgMf82X zmwjGBA^Ix9d?E1!3@zt@KlwrlpLD3=6LeVL%9cvVD~tHDJ2@5i!Z#IwEosh`U{VAl z;q#L`>cKqh63a7?_G2{qA(ZPCe$f}6JTk>!cJR!okw5u zi44E)2sU`*EBJu#or4wLnA?@ZeZX)#V5AffiUVqIz-b5X@DX1PK5V^;CjR8(?Afu| z*$=MFPR&lvCZoTp+3DGHC{G0JRlt`jQy~%3A7`2GOz-vUHP<`ZT4Xh^;xmCl11 bM=~ttB`%Czn!G%9dFuZFIyY8* literal 0 HcmV?d00001 diff --git a/__pycache__/window.cpython-34.pyc b/__pycache__/window.cpython-34.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44e9fac64a854dbe3b4c9ed0c7bd64f59240ef15 GIT binary patch literal 2798 zcmb7GOK%fb6h3zzwqxuh1OkDol(rOgXcM6>5rQhvc2Q)tG8L+oYBZTUNleCLb7x#9 zR#>G1{tEx7nr&BX5bLh`oipPhal?X}%<;K%U*Gx8WA58lySe+>-@mIm(LZ#eIncky zliq;P_*WDYJ^o2sq;2{OFKmhw9oy8y8;81{`vx<~Q@OeovNmhH6Swp=L`2k6ydSSp z^pa=?UD@-6qMprLX_xo!L8+0hi|&$ckX{fSFPo&#iC!n&BHb1p6BbD?iM~L3ne=(l zF?ogb1<}uuzDRmibS%6?`m*S4(rcuzh`z|Ey57~i_N1Ta;iMBby}{EGKA?ri;*Mkd|be7yBAO82wjXlrzs?G2OlNk7|LFZ8X6 zfZiA#ni|ew@>3S1E~x2JVbR9y?2v(R<6pM!0iN^|2sQ)%Fav{``09i~)0OTx45M^s z9LI;(_xo`iY0owbSeVy!lxAjln7bp>Pcl!L240(Um1yy-g)knbkspjkJX#`btLbuy zuo@1TEpBWCTO<%~LIL?e38s%Ef{wtyvYy*?WY2I5{dOmJvgjbo>)~)P2oepVYn$UN z8z#9k3c`KQ5rny&VUn{mPQqMm&*QCyQL>pOjJ*WArl#!~SQ!gl402>%rQ}Xu#2tG-rdi+dzjaP1fgS) z-5h=9DnxE|e<;ECnhBP7LlZ^Ge8{miyg5h28P@R7DNlc-H7Na!%9@43nqK1<6aCpA zj#IJ7e1W4&gMj_Z_q})b%??4a%zKTL1C4j@&DN8_=*eG1?qhLFV#S5N$q5@QNdUm`W&wGNC|Iv2*IYTaz ze`PNDF?z}uY=J};*OEEZ#Ycg^Yf_@XnTJV+lWP{zQkDK!fuaP*+{CmQZzt;KJOG9% z0N8~m0Tj_)g|>vVs_JF0IWfT~j*{JMum2V~GIMhUF;_D$o3l_h2IDyE0}U^j;hcRo zXJZvrHYRZ*3eumU99%0)0cX-fwmf>ZZ~ zqI@{{;-sJK4E=DgA8Ug|;}T{*WpNz>LCgh93QJy_^!093)-CaXR2DmlCLDli6N0Y- zi>jsC*0fnxFbsQ3d?!hQL4-R=)At8MJ&sv#`TnzU5EmnIsgU|^F7u&M?kgyUy=%T^ zaf`(_EY?}vW>G~1>Ma8?j7_dXOk~PI+)}Gfi~rn~UH*wCvpSxg*Ry@xDk77+KN?__ W_wP3@G%>kxx3J(If0)FRP3u1g+5MFO literal 0 HcmV?d00001 diff --git a/dist/LearnPythonWithPython.exe b/dist/LearnPythonWithPython.exe new file mode 100644 index 0000000000000000000000000000000000000000..f2a727f711ce39dc2715dc5c1ce962d179bb1b40 GIT binary patch literal 23552 zcmeHv3w%`7x$m0HBpG1B3^;)xpkqxGNOfmzW z(|dpS-rxP*UpIVv@3p@FTI*Zi`qsC;wRVyfYxXfEV@w5##~C|>CtVJH|IcqC*i)~4 zaw_}Tq?fKcq^N)Cx@Lc8*boc_Hip`I4DD^by@7~fgU=9(_8K~S4b>}MhMs`ew>T$f za=u*k&NuFy{oKD@RhOXOF8F%g2-3e@Fj#klKM(Qrv6pw$JmK0wKd*a-KljME z0r~kg{%q=O_fwsT9yn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Z z&XRAGe81$ylHZp6zT`s5=F)GL{zK`5rH_^VwDeHvQ0eofFPHwh^v%-Wm5QYwmMU%2 zZ8z8!+Lqha+S+X2uzkn&pzTMt!?qV~uh`zUePsL07PsZtue0A|zu8`HZ?vzmd+a^- zo%Va|U$_6G{R#V%_Gj!b+26IlZ~xH#xqVvM)n(U~Eh?)jyQOSp*}Aej%C?r>RW?|* zzw9w+>glo*Wus;9lzmX9D4$%eEuUL%EVq?cmaiypEAJ`~l;2tYjq>l5KUn^w^26mX zmcLT|cKJu;pOweUb1JT@xT)giit>uaiZvCUik^y{757wpz2YA$o~U@T;+cwVp`?ZmDg4-s;sKKrE+EEy2?8$w^rU&Ias;B^0CUFR6bpKqH?tIoyrd?Y4h5>yAZzy9g`Gvgg?K_SyEY*yr1g_ELM5eTCg^ zUu$o(Z?Z@1ci9E|KKn!V@7w{{`>gjv2M<{vv7WY`v7Y5WSq;G7uKz6>_#aa%+a&-1 literal 0 HcmV?d00001 diff --git a/screens.py b/screens.py index a0e48da..66f7339 100644 --- a/screens.py +++ b/screens.py @@ -5,16 +5,16 @@ class Screen: def __init__(self, title, showAs, func): self.title = title self.showAs = showAs - self.screenFunc = func + self.func = func -class LessonScreen: +class LessonScreen(Screen): def __init__(self, i, text, screenFunc): title = "Lesson "+str(i)+": "+text showAs = title func = screenFunc super(LessonScreen, self).__init__(title, showAs, func) -class ProjectScreen: +class ProjectScreen(Screen): def __init__(self, unit, proj, partTitle, screenFunc): text = "Unit "+str(unit)+" - "+proj+": "+partTitle showAs = partTitle @@ -22,108 +22,106 @@ def __init__(self, unit, proj, partTitle, screenFunc): super(ProjectScreen, self).__init(title, showAs, func) class Screens(Window): - homeBounds = "800x1000" - screenBounds = "800x400" def new_lesson(self, unit, screenNum): screenNum -= 1 + self.master.geometry(self.screenBounds) unitStr = "self.u"+str(unit) - u = exec(unitStr) - self.new() - self.cenLbl(u[screenNum].text) + u = eval(unitStr) + self.new(1) + self.cenLbl(u[screenNum].title) if screenNum > 0: - prevBtn(u[screenNum-1].func) + self.btnPrev(u[screenNum-1].func) if screenNum < len(u)-1: - nextBtn(u[screenNum+1].func) + self.btnNext(u[screenNum+1].func) def __init__(self, master=None): + self.homeBounds = "800x1000" + self.screenBounds = "800x400" + self.units = [ + + ] + self.u1 = [ + LessonScreen(1, "Setting up the IDE", self.idle), + LessonScreen(2, "Basic syntax", self.syn), + LessonScreen(3, "Variables", self.var), + LessonScreen(4, "Data types", self.data_types), + LessonScreen(5, "Hello, world!", self.hello_world), + LessonScreen(6, "Input", self.inp), + LessonScreen(7, "If statements", self.if_statement), + LessonScreen(8, "Else and elif statements", self.else_elif), + LessonScreen(9, "\"WHAT THE HECK IS A METHOD!?!?!?\" (your comments)", self.methods), + LessonScreen(10, "A function. Ok? I will tell you what a function is.", self.functions) + ] super(Screens, self).__init__(master) self.master = master self.master.title("LearnPythonWithPython") self.pack(fill=BOTH, expand=1) - self.u1 = [ - Screen(1, "Setting up the IDE", self.idle), - Screen(2, "Basic syntax", self.syn), - Screen(3, "Variables", self.var), - Screen(4, "Data types", self.data_types), - Screen(5, "Hello, world!", self.hello_world), - Screen(6, "Input", self.inp), - Screen(7, "If statements", self.if_statement), - Screen(8, "Else and elif statements", self.else_elif), - Screen(9, "\"WHAT THE HECK IS A METHOD!?!?!?\" (your comments)", self.methods) - ] def s_init(self, unitNum): - self.new(home=True) + print("s_init") + self.new(0) s = "self.unit_"+str(unitNum)+"()" exec(s) self.master.geometry(self.homeBounds) def unit_1(self): - for i in range(len(self.screens)): + print("u1") + for i in range(len(self.u1)): s = self.u1[i] - self.cenBtn(s.showAs, lambda: self.goTo(s.func)) - - def goTo(self, func): - self.master.geometry(screenBounds) - func() + self.cenBtn(s.showAs, s.func) def idle(self): - self.new_lesson(1) + self.new_lesson(1, 1) self.multiLbl("Hello, and welcome to LearnPythonWithPython. Today we will be learning about how to set up the IDE called IDLE but ... come to think about it, you are viewing this application so you probably already have IDLE installed. See you later.") def syn(self): - self.new_lesson(2) + self.new_lesson(1, 2) self.multiLbl("Congratulations! You've completed lesson 1. This is lesson 2. To see the basic syntax, look at the source code for this application.") def var(self): - self.new_lesson(3) + self.new_lesson(1, 3) self.multiLbl("Just like literally every single coding language in the world (except for maybe like BASIC and Assembly) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!") def data_types(self): - self.new_lesson(4) + self.new_lesson(1, 4) self.multiLbl("As I said last lesson, variables can be mmmmmmaaaaaannnnnnyyyyyy different types of things. A variable can be an str which is an str-ing of text surrounded by quotes (e.g. \"Hello, world!\"), an int which is an int-eger (e.g. 42), a float which is a float-ing point number (e.g. 3.14159265358979323846264338327950288419716939937510), a boolean which is a boolean value (which is either True or False. I think it's False. Wait nevermind it's true.), an array which stores an array of values surrounded in brackets where all the values are seperated by ,s (e.g. [\"Why?\", \"Are we stronger than the elements?\", \"What's yellow and dangerous?\", \"What do you get when you multiply six by seven?\", \"How many Vogons does it take to change a lightbulb?\", \"How many roads must a man walk down?\", 42, True, [\"Waaaait... an array inside an array?\", \"that's cray-cray\"], \"Is the array done yet?\", False,...] you get the idea.), a dictionary which is basically a dictionary for variables (e.g. ages = {\"Bob\": 100, \"Me\": 11}) and sooooo on and soooo forth") def hello_world(self): - self.new_lesson(5) + self.new_lesson(1, 5) self.multiLbl("Hello world programs are usually the first to be learned because they are so simple, but why do they make them so simple? Those programs could be made harder and more fun by just a little bit. First things first, you need to know what a hello world program looks like, so look in the console. Go on. I'm not going anywhere. You want to be able to do that? Well, that sucks for you. This lesson is not about hello world. It's about the base methods in Python. \"What's a method?\" I hear you typing in the comments. Well, I'm not telling you. And also I don't read the comments. So sucks for you.\nSo any ways, there are many base methods >:(don't even try asking):< such as print and input. Print prints text to the console. Input asks the user for input. That simple. Well not really. In print you have to put () after it because it's a *method* and inside those parentheses put what you want to say (HAS TO BE AN STR (can be a variable)), for example print(\"LearnPythonWithPython\") will print LearnPythonWithPython. Seriously. Try it. PRESS LE BUTTON!!!") - code = """ - print("LearnPythonWithPython") - """ + code = """print("LearnPythonWithPython")""" self.cenBtn(code, lambda: exec(code)) self.cenLbl("It's time for CHALLENGE TIME: Try to make a hello world program by declaring a variable called string and print()ing it") def inp(self): - self.new_lesson(6) + self.new_lesson(1, 6) self.multiLbl("Hello, world! That last (mini) project was fun...ish. We want to make programs with UI! We want user input() ... i mean interface lol lmao rofl lellellellellelelelelelllelleleellelelelellelelel. so user \"interface\" as they call it is an interface where users interact. Hey! There's another possible name! User Interaction stuf! well anyways, let's get to the point. The input() method is a good starting point for UI. It allows the user to enter ... wait for it ... input()! Inside the parentheses thingies, you have to type in what ever you want the computer to ask you. For instance, press the button that has a line of code on it.") - code = """ - inp = input("Enter your input here: ") - print(inp) - """ + code = """inp = input("Enter your input here: ") +print(inp)\t\t\t\t""" self.cenBtn(code, lambda: exec(code)) self.cenLbl("Now you try to figure out a practical purpose for the input() method. Enter it in the comments (that I tooooootally read)") def if_statement(self): - self.new_lesson(7) + self.new_lesson(1, 7) self.multiLbl("If statements determine *if* a condition (e.g. 1>2 is False and \"hello\" == \"hello\" is True) is True, then it does the stuff indented after the colon(:). One example is") - code = """ - if True: - \tprint("if True: \n\t\"is always evaluated\"") - if False: - \tprint("if False: \n\t\"is never evaluated\"") - """ - self.cenBtn(btnText, lambda: exec(code)) + code = """if True:\t\t\t\t\t +\tprint("if True: is always evaluated") +if False:\t\t\t\t\t +\tprint("if False: is always evaluated")""" + self.cenBtn(code, lambda: exec(code)) def else_elif(self): - self.new_lesson(8) + self.new_lesson(1, 8) self.multiLbl("\"But ... what if you want to test if something you just tested is not True? Do you need another if statement with (whatever condition) == False?\" I hear you commenting in the comment section. Well, the answer is NO STUPID!!! THIS IS PROGRAMMING!!! AND THIS LESSON EXISTS!!! LOOK AT THE TITLE!!! WHAT DID YOU THINK IT WOULD BE ABOUT??? The solution lies in else statements, which literally translate to ... you guessed it — else. You just type else: and then whatever the print(\"****\") you want if the condition you tested is false. \"But what if you want to have an if and else statement *inside* an else statement?\" The answer is THIS IS CODING YOU NOT SMART PERSON. And plus, it says it in the title. elif is short for else if which is short for else-erwise if this is true.") def methods(self): - self.new_lesson(9) + self.new_lesson(1, 9) self.multiLbl("Now, we're finally going to answer that question: \"WHAT THE HECK IS A METHOD?!?!?!?!?!?!?!?!?!\" Geez. Stop commenting. ITS BAD 4 UR PUNCSHOOASHUN CUPZ LOC KEE AN SPELEENG. IT WILL TURN THE SQL DATABASE THAT I DON'T READ INTO A YOUTUBE COMMENTS! I LITTERALLY MAKE THE WORDS UR COMMENT HAS BEEN RECIEVED APPEAR EVEN IF I NEVER READ IT!!! SHOOT MY CUZ LUC KEE IZ BROCEN I M USING A MAC ALL MY TEXT IS NOW AND FOREVER CAPITALIZED :(:(:(:(:(:(:(") self.multiLbl("SO, ANYWAYS, A METHOD IS A FUNCTION INSIDE OF A CLASS. \"WHAT ARE FUNCTIONS AND CLASSES?\" YOU WILL FIND OUT NEXT LESSON.") def functions(self): - self.new_lesson(10) - self.multiLbl("A function. Use def function_name:\n\t#insert_code_here to create a function and function_name() to call it.") + self.new_lesson(1, 10) + self.multiLbl("A function. Use:\n def function_name(args):\n\t#insert_code_here\n to create a function and function_name(args) to call it. You can have as many args as you want and they can be whatever you want. Be warned. Functions are eeeeevvvvveeeeerrrrryyyyywwwwwhhhhheeeeerrrrreeeee. Print is a function. Input is a function. If you look at the source code, you might see functions such as eval and exec. There are many other functions just 2 name a few.") + diff --git a/setup_exe.py b/setup_exe.py index 80d36f6..5296942 100644 --- a/setup_exe.py +++ b/setup_exe.py @@ -1,10 +1,11 @@ -from distutils import setup +from distutils.core import setup import py2exe -import windows, screen +import window, screens setup( - windows = [{ + console = [{ "script": "mainloop.py", + "icon_resources": [(1, "pycon-icon.ico")], "dest_base": "LearnPythonWithPython" }] ) diff --git a/window.py b/window.py index 304a837..664069d 100644 --- a/window.py +++ b/window.py @@ -3,7 +3,7 @@ class Window(Frame): def __init__(self, master=None): super(Window, self).__init__() - self.s_init() + self.s_init(1) def close_app(self): self.master.destroy() @@ -21,8 +21,8 @@ def choBtn(self, txt, func, x, y): def btnQuit(self): return self.choBtn("Quit", self.close_app, 0, 0) - def btnBack(self): - return self.choBtn("Back", self.s_init, 0, 0) + def btnBack(self, unit): + return self.choBtn("Back", lambda: self.s_init(unit), 0, 0) def btnNext(self, nextScreen): return Button(self, text="Next", command=nextScreen).place(relx=1.0, rely=1.0, anchor=SE) @@ -39,12 +39,12 @@ def cenLbl(self, txt): return Label(self, text=txt).pack() def multiLbl(self, txt): - return Label(self, text=txt, anchor=W, wraplength=425).pack() + return Label(self, text=txt, wraplength=750).pack(anchor=W) - def new(self, home=False): + def new(self, unit): for widget in self.winfo_children(): widget.destroy() - if home == True: + if unit == 0: self.btnQuit() else: - self.btnBack() + self.btnBack(unit) From 2b2f4dd9ac0ef5c23d4ed7111842bd2b28697a9f Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Sun, 15 Oct 2017 20:12:13 -0700 Subject: [PATCH 09/11] Delete exe.md --- appinst/exe.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 appinst/exe.md diff --git a/appinst/exe.md b/appinst/exe.md deleted file mode 100644 index ab506c7..0000000 --- a/appinst/exe.md +++ /dev/null @@ -1,11 +0,0 @@ -# The following should work -###### (from link in [Stack Overflow][link] and [py2exe](py2exe.org)) - -### Step 1: -Download setup.exe -### Step 2: -$ python setup.py py2exe -### Step 3: -In your project folder find dist/ - -[link]: https://stackoverflow.com/questions/3945179/problems-with-tkinter-in-py2exe From 2e5998fae718fcea41f4242f3edc94b996e16376 Mon Sep 17 00:00:00 2001 From: Sa'ar Date: Mon, 16 Oct 2017 09:13:04 -0700 Subject: [PATCH 10/11] Update screens.py --- screens.py | 63 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/screens.py b/screens.py index 66f7339..7299f6e 100644 --- a/screens.py +++ b/screens.py @@ -38,9 +38,6 @@ def new_lesson(self, unit, screenNum): def __init__(self, master=None): self.homeBounds = "800x1000" self.screenBounds = "800x400" - self.units = [ - - ] self.u1 = [ LessonScreen(1, "Setting up the IDE", self.idle), LessonScreen(2, "Basic syntax", self.syn), @@ -51,7 +48,16 @@ def __init__(self, master=None): LessonScreen(7, "If statements", self.if_statement), LessonScreen(8, "Else and elif statements", self.else_elif), LessonScreen(9, "\"WHAT THE HECK IS A METHOD!?!?!?\" (your comments)", self.methods), - LessonScreen(10, "A function. Ok? I will tell you what a function is.", self.functions) + LessonScreen(10, "A function. Ok? I will tell you what a function is.", self.functions), + LessonScreen(11, "I told you. Object oriented programming is functions. Well, sort of.", self.oop) + ] + PROJ = "Battleship" + self.p1 = [ + ProjectScreen(1, PROJ, "What you're building", None), + ProjectScreen(1, PROJ, "An empty list", None), + ProjectScreen(1, PROJ, "Making the board", None), + ProjectScreen(1, PROJ, "Printing the board", None), + ProjectScreen(1, PROJ, "Hiding the ship", None) ] super(Screens, self).__init__(master) self.master = master @@ -59,17 +65,28 @@ def __init__(self, master=None): self.pack(fill=BOTH, expand=1) def s_init(self, unitNum): - print("s_init") + self.new(0) + s = "self.unit_"+str(unitNum)+"()" + exec(s) + self.master.geometry(self.homeBounds) + + def p_init(self, unitNum): self.new(0) s = "self.unit_"+str(unitNum)+"()" exec(s) self.master.geometry(self.homeBounds) def unit_1(self): - print("u1") - for i in range(len(self.u1)): - s = self.u1[i] + for s in self.u1: self.cenBtn(s.showAs, s.func) + self.cenBtn("Unit project: Battleship", lambda: self.p_init(1)) + self.cenBtn("Unit 2: Turtle graphics", None) #s_init(2) + + def proj_1(self): + for s in self.p1: + self.cenBtn(s.showAs, s.func) + self.cenBtn("Back to unit 1", lambda: self.s_init(1)) + self.cenBtn("Unit 2: Turtle graphics", None) #s_init(2) def idle(self): self.new_lesson(1, 1) @@ -117,11 +134,39 @@ def else_elif(self): def methods(self): self.new_lesson(1, 9) - self.multiLbl("Now, we're finally going to answer that question: \"WHAT THE HECK IS A METHOD?!?!?!?!?!?!?!?!?!\" Geez. Stop commenting. ITS BAD 4 UR PUNCSHOOASHUN CUPZ LOC KEE AN SPELEENG. IT WILL TURN THE SQL DATABASE THAT I DON'T READ INTO A YOUTUBE COMMENTS! I LITTERALLY MAKE THE WORDS UR COMMENT HAS BEEN RECIEVED APPEAR EVEN IF I NEVER READ IT!!! SHOOT MY CUZ LUC KEE IZ BROCEN I M USING A MAC ALL MY TEXT IS NOW AND FOREVER CAPITALIZED :(:(:(:(:(:(:(") + self.multiLbl("Now, we're finally going to answer that question: \"WHAT THE HECK IS A METHOD?!?!?!?!?!?!?!?!?!\" Geez. Stop commenting. ITZ BAD 4 UR PUNCSHOOASHUN CUPZ LOC KEE AN SPILEENG. IT WILL TURN THE SQL DATABASE THAT I DON'T READ INTO A YOUTUBE COMMENTS! I LITTERALLY MAKE THE WORDS UR COMMENT HAS BEEN RECIEVED APPEAR EVEN IF I NEVER READ IT!!! SHOOT MY CUPZ LUC KEE IZ BROCEN I M USING A MAC ALL MY TEXT IS NOW AND FOREVER CAPITALIZED :(:(:(:(:(:(:(") self.multiLbl("SO, ANYWAYS, A METHOD IS A FUNCTION INSIDE OF A CLASS. \"WHAT ARE FUNCTIONS AND CLASSES?\" YOU WILL FIND OUT NEXT LESSON.") def functions(self): self.new_lesson(1, 10) self.multiLbl("A function. Use:\n def function_name(args):\n\t#insert_code_here\n to create a function and function_name(args) to call it. You can have as many args as you want and they can be whatever you want. Be warned. Functions are eeeeevvvvveeeeerrrrryyyyywwwwwhhhhheeeeerrrrreeeee. Print is a function. Input is a function. If you look at the source code, you might see functions such as eval and exec. There are many other functions just 2 name a few.") + + def oop(self): + self.new_lesson(1, 11) + self.multiLbl("You thought this lesson was going to be about classes? Ha! weeeelllllll, technically object oriented programming is classes. You see, a class has the basic methods and variables. An object is one version of a class. Let me explain and show you the syntax for a class at the same time by making a student class. I'll show you how.") + code = """class Student:\t\t\t +\tdef __init__(self, name, grade, gpa):\t +\t\tself.name = name\t\t\t +\t\tself.grade = grade\t\t\t +\t\tself.gpa = gpa\t\t\t\t\t +\tdef __repr__(self):\t\t\t +\t\tprint(self.name+" has been in school for "+str(grade+1)+" years and his gpa is "+str(gpa) + +billy = Student(\"Billy Bob Joe\", 5, 3.95) +print(billy)""" + self.cenBtn(code, lambda: exec(code)) + self.cenLbl("Two underscores signify a special keyword, and in the case of a class, it's usually a method name. The __init__ method is run as soon as the object is initialized, and it takes in self and whatever other arguments you want it to. Self refers to the class. The __repr__ and __str__ methods are what happen when you want it to be a string, __repr__ is like the official one and __str__ is called when you use str(object_name). You also have __del__ and __call__ and many, many more. You can also create methods but the first argument is always self and to run it from another method in the class, you have to do self.method_name or you can run it like ObjectName.method_name. You can also have static methods which are called by ClassName.method_name(args) and don't have a self. To define a static method, you do @staticmethod above the line with the method.") + def loops(self): + self.new_lesson(1, 12) + self.multiLbl("I'm doing this out of order but who cares. A loop is something that repeats. There are two types of loops. A for loop and a while loop. This should show you the difference") + code = """for item in ["Hello,", "World!", "foo", "bar"]: +\tprint(item)""" + self.cenBtn(code, lambda: exec(code)) + code = """i = 0 +while i < 4: +\tprint(i) +i += 1""" + self.cenBtn(code, lambda: exec(code)) + self.multiLbl("So as you can see, a for loop loops for every item in a list and a while loop repeats while a condition is true. For for loops, a function that is commonly used is range(n). Range makes a list of numbers between 0 (inclusive) and n (exclusive). So range(3) returns [0, 1, 2] and range(1) returns [0]. If you're using for with a dictionary, for thing in dict will make thing the key but for key, value in dict will have key as the key and value as the value. Mind blown. A while loop will run while the condition is True.") From 03f4daafe8b0a2aee641f6fe9b1c904bc2a50d7e Mon Sep 17 00:00:00 2001 From: Belvedere Tiburon Library CoderDojo Date: Thu, 19 Oct 2017 16:38:17 -0700 Subject: [PATCH 11/11] Update files --- __pycache__/screens.cpython-35.pyc | Bin 2995 -> 16411 bytes __pycache__/window.cpython-35.pyc | Bin 2639 -> 2798 bytes mainloop.py | 1 + screens.py | 40 +++++++++++++++++------------ 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/__pycache__/screens.cpython-35.pyc b/__pycache__/screens.cpython-35.pyc index 3f2dfdadf229fff370f42134dc26eef4018409dc..5bc5b55656b63a83a44901389f887dfd9a133acf 100644 GIT binary patch literal 16411 zcmc&*+ix3JejZBHjg}I}jxR~P$+41Mi-}C=Vmr3##GxeGVj@#oky@{{35XGAB#uSS zFf&8TWaFZMx7+rm4@H4K7ARU2Mfah7YyTBKwogX?g8~KmeZMm^BxNN?c7yKN91YK$ z>+kaYF6Z##%uMD_Z@ql{_8%F>e;ET;8qc5M69l+f_@6QwhEd_uh|x$H%@Jd7#7I4` zMhz=%{2Ik+;|0n_jR)44VU0`CxM7bPFGh{MG)gB7Yf?%lx@y(PQS#!MmE(;eTdumBgeJ8;~LB2YXlFU;S*fJ%{Gj^6eo&VVXl}Y=7iZ`e&uYs zH(sv!w(Zu^sLG3f*?tY5;62>FNg3Z5Mimbu@_?_S@__CPbdf4$M|)$T6E^JLcu@C_ z^Fc3t&~|I+JRR7L1Ah#?_~X1y;P%gkKZQU4v$(eM@i@EMrsQGy07a+$cg@Z~QapL1r^>%dm`8;3ps{rc?5Lh{U5P=M~K2Hb~+>H;e;NSqS|b zAv8+LAkp-u9R!|xg50DC2V#H0I&Nqg3ejJrj7wnFC6N8n^R)3z+IT)j(mx+JLevpv zK(3yE8F-6V;}nvVC8L$P6M8t+9a&MJ#%K`wy|JL(vVH$`3?oa=PWY2}?xmbwI<%jK zy^JRIeQ@st*C1(A)oQI_20^u|sU?IW1^Efsk&(Kb8pprxg~7EZT*;>WX;kuOczcbv zVftrN{sopw$DAY|Vh-^8@5zCg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P%I|CBCJ^D8%;%Cq|%a7$mKUen2)zTe&@4$k6_%=3&wv zswexwItUd`>Xwc756S~FnuPhCa;Aq*9EXh!v?alxoAZkk5E5gc4giVx$3fEc8ITDp zO#1(wql3WgrD(sh3*IEH!o7(`uwCUW3fDNByH#Ge&4RejZb``-)#%fg!dq*2y(wi_ zjkeh)z5x<$M#9HlJ^U-F2DCVdFb~NkGH?oEcJFtZ%YnUIVufduU3#{J4}m~Jy7b|a zhQ40q1Cd8DiWk7VK==w7`f_x{%VlyPCSEE!$?lDb>E4|&mbp0DtBq!TBjVTbI!Iih IpAK2S0b$TKV*mgE diff --git a/__pycache__/window.cpython-35.pyc b/__pycache__/window.cpython-35.pyc index eca0b3f7ef0b9f7375228c0c8df3a22d47c960b7..7112cd04a20292a5cc5c48dfec10f336cd633688 100644 GIT binary patch delta 1189 zcmZuwOK;Oa5Z?78PE1lLeL-8=iWZ1PRSB+CL871vfg+>`6(SIFY$tJX>}c(fwyM-a z5bd@2A8_NufeRP@0TNfV7r6FPapeRv>%>Y_EbnLUcs!49zWqLVI;Bq+3i=o0D7X5$6ANLS(#ou9BN=}|&$v`gg^N(hM^%4jD3LEATSu;rTV zgb@pNx!Pu~9~qQo!OYI3kdFiD{Q?@f9PLD0sds#f)7ps3qTGFW0e=}sKf1%|t|76D zxKZ1lX*otFi93l-QwWz3E+b4M3@7|4x8~>2cpl(?6*ZOOfdt?1!lw#Lh811|I3i@5 z5NI9fIHaU55gTrqyaS_xcTWL2)N)n1XIif<_#?eA)u0FcBv5)@VpT82V2FpEkJ z=|J?um5%R5N%493$g}I7*{a!Q2|Ej6k-eoY*SCZ2S}pQ1;o7?+tAu*Aid;nCmyzROl%XUJl*gFIVlo;HLzn+N{jSTiQU zwn8yEx;F;A#Gf)xH-vCfIT#XGADcDD6Y&joNH?hum%W-d(#xjyvWRh@76Tp(r#RqJ zXl__v-?ZCs1paDs&p;MEDs5AgMI@0Pp{NWdSkb%8Y3c?Zq z@SkdgXS%N4aQYGyP3GhKxpFy!-gti441zdLX#{p1ZAFBe2&)Kd2)7VYu0WJJ8uIb4 Y+-5N~Ck}nRw*tH4IVIGvn5-`S0|S`YlmGw# delta 925 zcmaJIx?9(6bzN4a;|GG^X+^=sFIa+5u^L#GHc8vmB(0OwRuDX_ zARgCv@#;lu!;(>1STJ6Fdw>6jwr{lQ zyZzwJqO(e#QDT+Ib3z)dnpEi;T~9V?t*}Q3b!#nZ!Mxr8F_Rf=wl}F19(w~e#>^5#?!cmkhFww7-0or z8DTcz7dfb{qOk9@K2$Qz8Jv|GLgwl1vn_{lRLEs8)>^WUGp3~uT-ZWLD<23OKLOLl~2)==~lL&PLhHwVq mJVGWDOky4lh2*Jmqn??kgaZ5#`lVptjC}VpPGp4b8PZRO{ifpp diff --git a/mainloop.py b/mainloop.py index 99e2a87..481aea0 100644 --- a/mainloop.py +++ b/mainloop.py @@ -7,3 +7,4 @@ master.geometry("500x250") app = Screens(master=master) master.mainloop() + diff --git a/screens.py b/screens.py index 7299f6e..8be6268 100644 --- a/screens.py +++ b/screens.py @@ -19,7 +19,7 @@ def __init__(self, unit, proj, partTitle, screenFunc): text = "Unit "+str(unit)+" - "+proj+": "+partTitle showAs = partTitle func = screenFunc - super(ProjectScreen, self).__init(title, showAs, func) + super().__init__(text, showAs, func) class Screens(Window): @@ -49,7 +49,8 @@ def __init__(self, master=None): LessonScreen(8, "Else and elif statements", self.else_elif), LessonScreen(9, "\"WHAT THE HECK IS A METHOD!?!?!?\" (your comments)", self.methods), LessonScreen(10, "A function. Ok? I will tell you what a function is.", self.functions), - LessonScreen(11, "I told you. Object oriented programming is functions. Well, sort of.", self.oop) + LessonScreen(11, "I told you. Object oriented programming is classes. Well, sort of.", self.oop), + LessonScreen(12, "Loop-da-loops", self.loops) ] PROJ = "Battleship" self.p1 = [ @@ -72,7 +73,8 @@ def s_init(self, unitNum): def p_init(self, unitNum): self.new(0) - s = "self.unit_"+str(unitNum)+"()" + s = "self.proj_"+str(unitNum)+"()" + print(s) exec(s) self.master.geometry(self.homeBounds) @@ -98,7 +100,7 @@ def syn(self): def var(self): self.new_lesson(1, 3) - self.multiLbl("Just like literally every single coding language in the world (except for maybe like BASIC and Assembly) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!") + self.multiLbl("Just like literally every single coding language in the world (except for like binary) and for sure every C based coding language (hint hint: Python is a C-based language), there are variables. There are many different types of variables in Python. Some examples are booleans (coming from Boolean algebra), lambdas (from lambda calculus) and numbers (from litterally every single form of math). Unlike 6th grade math, 7th grade math, 8th grade math, 9th grade math (Algebra I), 10th grade math (Geometry), 11th grade math (Algebra II), 12th grade math(Trigonometry?), college math(Calculus, Linear algebra, etc, etc, etc, and etc.), and some high school and college science(physics), variables in coding can have names longer than 1 letter with subscript. The only downside is that it takes up memory, and it takes up soooo mmuch storage. Like entire bytes. Soooooooo much!!!") def data_types(self): self.new_lesson(1, 4) @@ -144,29 +146,33 @@ def functions(self): def oop(self): self.new_lesson(1, 11) self.multiLbl("You thought this lesson was going to be about classes? Ha! weeeelllllll, technically object oriented programming is classes. You see, a class has the basic methods and variables. An object is one version of a class. Let me explain and show you the syntax for a class at the same time by making a student class. I'll show you how.") - code = """class Student:\t\t\t -\tdef __init__(self, name, grade, gpa):\t -\t\tself.name = name\t\t\t -\t\tself.grade = grade\t\t\t -\t\tself.gpa = gpa\t\t\t\t\t -\tdef __repr__(self):\t\t\t + code = """class Student:\t\t\t\t\t +\tdef __init__(self, name, grade, gpa):\t\t\t +\t\tself.name = name\t\t\t\t\t\t +\t\tself.grade = grade\t\t\t\t\t\t +\t\tself.gpa = gpa\t\t\t\t\t\t\t\t +\tdef __repr__(self):\t\t\t\t\t\t \t\tprint(self.name+" has been in school for "+str(grade+1)+" years and his gpa is "+str(gpa) -billy = Student(\"Billy Bob Joe\", 5, 3.95) -print(billy)""" +billy = Student(\"Billy Bob Joe\", 5, 3.95)\t\t\t\t +print(billy)\t\t\t\t\t""" self.cenBtn(code, lambda: exec(code)) self.cenLbl("Two underscores signify a special keyword, and in the case of a class, it's usually a method name. The __init__ method is run as soon as the object is initialized, and it takes in self and whatever other arguments you want it to. Self refers to the class. The __repr__ and __str__ methods are what happen when you want it to be a string, __repr__ is like the official one and __str__ is called when you use str(object_name). You also have __del__ and __call__ and many, many more. You can also create methods but the first argument is always self and to run it from another method in the class, you have to do self.method_name or you can run it like ObjectName.method_name. You can also have static methods which are called by ClassName.method_name(args) and don't have a self. To define a static method, you do @staticmethod above the line with the method.") - + + def code(self, code): + exec(code) def loops(self): self.new_lesson(1, 12) self.multiLbl("I'm doing this out of order but who cares. A loop is something that repeats. There are two types of loops. A for loop and a while loop. This should show you the difference") - code = """for item in ["Hello,", "World!", "foo", "bar"]: -\tprint(item)""" - self.cenBtn(code, lambda: exec(code)) + code = """for i in range(3): + print(i) +""" + btn = Button(self.master, text=code) + btn.pack(anchor=CENTER) + btn.bind('', lambda e: exec(code)) code = """i = 0 while i < 4: \tprint(i) i += 1""" self.cenBtn(code, lambda: exec(code)) self.multiLbl("So as you can see, a for loop loops for every item in a list and a while loop repeats while a condition is true. For for loops, a function that is commonly used is range(n). Range makes a list of numbers between 0 (inclusive) and n (exclusive). So range(3) returns [0, 1, 2] and range(1) returns [0]. If you're using for with a dictionary, for thing in dict will make thing the key but for key, value in dict will have key as the key and value as the value. Mind blown. A while loop will run while the condition is True.") -