Kodi Arfer / Wisterwood

PMS University: Python Programming (sign-ups)

Topic List
#001 | mimir227 |
As sorta-kinda-promised, I'll be teaching a little course in Python programming this summer. The purpose of this topic is to confirm that my two prospective students (HeyDude and TheLoneRebel) are committed, to give anybody else who wants to a chance to join, and to set things up. Here's how I described the course last time:

----------
You may well wonder how, precisely, I'd conduct the class. The truth is that it depends largely on the language and the students. Rather than write up a textbook's worth of lectures, I'd prefer to use an online tutorial as our textbook, and some of these languages have better online tutorials than others. And if, for example, all of my students have at least a little programming experience, I won't have to spend any time on the very basics. But my basic idea is this: the class will be a sort of guided study of the text in question. I'll assign readings and problems, supplement the text with my own explanations and extensions as I see fit, and analyze your programs for style and correctness. (I won't grade your work, unless you really want me to, for some perverse reason.) I'll also answer any questions or provide any help you want— including re-explaining something in my own words if a part of the text just isn't working for you. And, of course, if you're new to programming, chances are you don't have appropriate software for it, so I'll help you set things up. (No, none of the software will cost money.)

I'll assign programming problems and readings on a, say, weekly basis. I won't kill you if you fall behind a little, but if you clearly aren't putting into the class what you need to in order to learn something, I'll kick you out.

There's no minimum class size: I'd enjoy tutoring a single student perhaps more than a whole class. I set no maximum, either, since I'm sure I can handle more people than will be willing to enroll.
----------

Let me say a bit more about Python specifically. Python's primary strength is its delicate balance between power and simplicity. It has enough features so that you can usually say just what you mean, yet it's small and regular enough that it can be easily learned and programs written in it can be easily read. Thus it works very nicely as a scripting language: a programming language you use to Get Things Done, to quickly and relatively painlessly whip up a program to make your life easier. Python programs may not be as computationally efficient as programs written in, say, C, but computers are so fast nowadays that just about any program you write will run in the blink of an eye. If you don't know how to program at all, or if the only languages you know were designed more for the convenience of the computer than the programmer, you stand to benefit from Python. On the other hand, if you already know and are happy with Perl, PHP, Ruby, or Tcl, or you're happy scripting with a fancier language like Common Lisp or Haskell, or you're one of those freaks who sees nothing wrong with shell scripts, you're unlikely to find Python very interesting.

[Continued in next post.]
#002 | mimir227 |
If you want to enroll, tell me if June 1 is a good time to begin. (I would assign the first reading on that day; the first programming problem would be due on June 6.) Also, install Python and tell me if the following tests work. You can get the installer for 32-bit Windows (Vista and otherwise) here:
http://www.python.org/ftp/python/3.0.1/python-3.0.1.msi
And the one for 64-bit Windows is here:
http://www.python.org/ftp/python/3.0.1/python-3.0.1.amd64.msi
The instructions at
http://www.revolves.net/2008/12/09/installing-python-30-in-windows-vista-a-small-problem/
may be useful. After installing, check your Path environment variable (on Vista, it's in Control Panel -> classic view -> System icon -> Advanced system settings -> Advanced tab -> Environment Variables -> System variables) and if it doesn't already contain "Python" somewhere, add "C:\Python30;" (without the quotes) to the front of it, being careful not to alter what's already there. Now go to All Programs -> "Python 3.0" -> "IDLE (Python GUI)". The window you see is running the Python shell, which lets you use Python interactively: type a chunk of Python code at the prompt and hit Enter and the shell will print the resulting value. For instance,
2 + 2*3
should cause the shell to reply with
8
The shell is handy for experimentation, but for anything reasonably ambitious, you'll want to use a text editor to write a program file, which you can then feed to Python in one fell swoop. (Also, when you run code in a file instead of typing it in at the shell, Python prints values only when you explicitly tell it to.) In theory, any text editor will do, even humble Notepad, but you'll want a reasonably featureful one— one that provides syntax highlighting for Python code, at the very least. The best editors are probably Emacs and Vim (I am in fact writing this post in GNU Emacs), but both have a steep learning curve. For our purposes, the editor built into the Python IDLE will do. Go to File -> New Window and type
print(1 + 1, 2 + 2, 5, sep="---")
Save this program as "test.py". Now open Windows's command prompt (just type "cmd" in the Start Menu search box) and type in the full path to "test.py" (if long paths make your head hurt, put the file at the root level of your hard disk, so you can just say "C:\test.py"), then hit Enter. You should see
2---4---5---Hello, world!
The same thing should happen if you precede the path with "python30 " (note the space). If one of these methods for running the program doesn't work, that's okay, so long as one of them does work.

Before I forget, let me point out that a wealth of documentation is available at
http://docs.python.org/3.0/
Beware that the material at "http://docs.python.org/" is for Python 2, an older version of the language incompatible with version 3.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#003 | TheLoneRebel |
Unfortunately June is my exam month; and so half way through i will have to focus on studying completely. i while attempt to keep up as I am still interested; but if it appears that I am not interested, then please be patient as I am simply focusing on more urgent matters.

Also thank you for offering to teach this course.
#004 | HeyDude |
Still gonna do it.
#005 | ShadowSpy |
Hmm...I'm interested in doing it, although finals week is the first week of June. I already know the basics of Python, but I don't know how much I've retained, since no one's required me to program anything with it. I figure it'll help if I get assignments and such.
---
"A period"
~~This is what I like to add to the end of almost every sentence.~~
#006 | mimir227 |
Given ShadowSpy's finals in the first week of June, and Rebel's in the second half of the month, perhaps it would be better to begin on July 1. That would be well into my vacation, but we'd still have almost two months before anyone would have to return to school. Would that work for you guys?

Don't forget to run the tests; whenever we actually do start, I'd like to be sure everyone's got things properly set up beforehand.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#007 | Dont Interrupt Me |
Y'know, I would be all over this if I wasn't planning on maybe taking a Python course at my actual university, for actual credit.
---
Slightly legendary.
#008 | mimir227 |
Well, if you want to learn as much as possible in the long term, taking my class will allow you to take one extra class at Penn. If, on the other hand, you just want to maximize your grades, taking this course should allow you to do well in a real Python course with minimal effort. Makes sense to me.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#009 | AzumarillMan |
But taking your course won't get him college credit...
---
Seth: What are you making?
Evan: I'm just drilling holes. Last two weeks, **** it.
#010 | mimir227 |
I understand that; my point (well, my latter point) is that taking a course for which you can get credit and doing well in it is much easier if you in fact already know what the course is supposed to teach you.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#011 | AzumarillMan |
I'll sign up. I'm taking computational linguistics and natural language processing in the fall and we'll be using Python for both, so why not?
---
Seth: What are you making?
Evan: I'm just drilling holes. Last two weeks, **** it.
#012 | mimir227 |
Great! Just be careful not to use the 2.x version of Python that ships with Mac OS. Install Python 3 yourself.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#013 | AzumarillMan |
Yup, will do. I'm looking forward to the course. Are you studying computer science at school as well?
---
Seth: What are you making?
Evan: I'm just drilling holes. Last two weeks, **** it.
#014 | mimir227 |
Not really. I'd like to take computer-science courses, but since I have two majors, I don't have a lot of room in my schedule. Last fall, I was able to take a mid-level class on basic computer organization and assembly language, and in my senior year, I hope to take a theory-of-computation course that would count towards my math major. Otherwise, I'm self-taught. For better or for worse, I've taught myself much more about practical programming than theoretical computer science.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#015 | mimir227 |
Unless there are any objections, I'm postponing the beginning of the course to July 1 for the reasons stated above. Everyone should confirm they've got Python 3 working before that date. You can reach me by email at "rdanger.co.cc" preceded by "ryan@".

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#016 | AzumarillMan |
http://img.skitch.com/20090526-1ntq9gjfpb8qi6yiwxgyayei1t.png
---
Seth: What are you making?
Evan: I'm just drilling holes. Last two weeks, **** it.
#017 | xXMithril5Xx |
Lol "ryan@"

I would sign up but my time right now is very tight. I need more in the way of specific day/time of courses to agree.

---
Anyone who acts like an idiot on this board gets treated like one. If you want to act the hormone-driven drool-monkey, you'll get mocked for it.
#018 | mimir227 |
I've now worked out almost all the details of how the course will work, and I can promise you, Gary, that there won't be any real-time component. I'll have a list of lessons on
http://rdanger.co.cc/python/
and your job will be to do at least one lesson a week. Doing a lesson will entail reading whatever text I've assigned along with my supplementary notes, and then writing a program or two. Generally, you'll have a choice of programming problems for each lesson, some easy and some hard, and I'll only require you to do one of them. If at any point you want to talk to me in real time, just use AIM, to which I'm signed on pretty much every day from 7:00 AM to 8:00 PM.

With these arrangements, I could of course have no due dates at all. You could just read the readings and do the problems whenever you wanted to. The problem with this is that I know from experience that many people— if not most people my age— need a kind of enforced schedule in order to get anything done. There are of course exceptions; I'm one of them. If you— and this goes to everyone— don't need due dates, feel free to ignore them. The one catch is that if you go too fast, you may finish all the available lessons before I've finished writing the next one.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#019 | mimir227 |
I'll keep this topic alive, through bumping if necessary, until at least July.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#020 | HeyDude |
Since we'll have no real-time component, I'll just install Python and such when you post the first lesson. Yay! Glad we'll get started soon.
#021 | mimir227 |
The first half or so of the course is complete and online, if anybody wants to start early.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#022 | ShadowSpy |
So I'm about to take my first final in two hours and my last final in 26 hours. Python programming can begin shortly after! Yeee!
---
"A period"
~~This is what I like to add to the end of almost every sentence.~~
#023 | mimir227 |
Fun fact: my cousin and my dad may take this course.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#024 | ShadowSpy |
Hmm....what would be the easiest way to record and send you a transcript of our session, mimir?
---
"A period"
~~This is what I like to add to the end of almost every sentence.~~
#025 | mimir227 |
Copy everything in the "Python Shell" window and paste it into the body of an email.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!
#026 | ShadowSpy |
Ahh see...Python opens in Windows command prompt for me. There's no copy/paste.
---
"A period"
~~This is what I like to add to the end of almost every sentence.~~
#027 | ShadowSpy |
I mean, I could do the 'python.exe > transcript.txt' thing, but that only shows output rather than my commands.
---
"A period"
~~This is what I like to add to the end of almost every sentence.~~
#028 | mimir227 |
Try using IDLE (the GUI) instead. I don't know much about the Windows shell's support for Unix-style output redirection, but I'd bet it's a bit of a hack.

---
WARNING: This post may or may not (but probably does) contain very tasteless humor.
It's not Mimi, it's not Mirmir, it's Mimir!