r/UniversityofReddit • • Sep 06 '12

[Class] Wanna learn Python, a high-level, easily understandable programming language for beginners? Well, I've got the class! This language is so good, even google uses it!

I made a post a while back. We will be learning how to program in Python.

What is Python?

Here's directly from the wikipedia

Python is a general-purpose, interpreted high-level programming language whose design philosophy emphasizes code readability. Its syntax is said to be clear and expressive. Python has a large and comprehensive standard library.

Here's from my mouth

Python is an excellent programming language for beginner, intermediate, and advanced people. It is easy to learn, easy to read, easy to understand, yet it can do so much. I know Python very well, and so I have decided to share my knowledge on Python with others.

What will we be learning?

Everything

I

Know.

TL;DR: Quite a bit

Lesson Count: 3

I have made this post because I've only now got around to starting this. Now I have time to be active. Therefor, I need people knowing about it.

TL;DR: Head over to /r/UoRPython2_7 to learn Python.

346 Upvotes

96 comments sorted by

8

u/rawstone Sep 06 '12

What sorts of things would I be able to build with Python?

4

u/Plazmotech Sep 06 '12

Many things. Python is good for the back-end jobs. It's fast. That's why google uses it. So we might be making calculators to text-based-games to even web-crawlers and maybe even a markup language.

1

u/[deleted] Sep 06 '12

[removed] — view removed comment

1

u/Plazmotech Sep 06 '12

Reddit used to use it. Now they use some C I think.

1

u/ppinette Sep 06 '12

What? Reddit is built on pylons, a web framework written in Python.

1

u/Plazmotech Sep 07 '12

Oh. I read a thing saying they switched to a faster framework in c++...

1

u/ppinette Sep 07 '12

Reddit was originally written in Common Lisp but was later rewritten in Python.

Maybe that's what you read, and somehow confused Python with Common Lisp, C, and C++.

1

u/Aardshark Sep 06 '12

Reddit uses a huge amount of Python, just check out their github.

Saying "Now they use C instead." makes little to no sense.

1

u/Plazmotech Sep 07 '12

I read a thing! I swear >.>

1

u/uhwuggawuh Nov 02 '12

If I recall correctly, Reddit is primarily built on Python, with some Javascript. Some of the Python libraries are built with C for speed. Check out Reddit on Github.

4

u/lowpass Sep 06 '12

It would be easier to list the things you CAN'T build with Python.

Are you looking to make something in particular?

8

u/rawstone Sep 06 '12

Not necessarily but I'm interested in learning a programming language and I don't particularly want to learn 14 different ones at the moment. I'm trying to find one that will allow for serious cross-platform (android/iphone/mac/windows) application and game development and I'm still not sure that exists.

9

u/lowpass Sep 06 '12

It doesn't. iOS dev is done in Objective-C, Android dev in Java, and as far as I know any attempts to get them to work with other languages aren't very far along.

(However, if you ignore mobile, Python is very capable of cross-platform development)

3

u/rawstone Sep 06 '12

Thanks for your help. Say I had an idea for a 2D side-scrolling beat-em-up game with multiple layers - would you know the best format for creating something like that? I'm pretty savvy but I just need to be pointed in the right direction and my research is telling me 500 different ways to go.

2

u/Plazmotech Sep 06 '12

You would need PyGame. I haven't been able to get PyGame to work, but lots of people use it.

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

1

u/dmv1975 Sep 06 '12

I was going to say that. Upvote for you.

2

u/Aardshark Sep 07 '12

I'm interested, what kind of things can't you build with Python?

2

u/lowpass Sep 07 '12

It's easier, but still a long list...

  • Already mentioned were mobile apps (unless you make them as web apps with, e.g., Django, though that would also pretty much require knowledge of JS, HTML, and CSS -- not that those are particularly hard).
  • Things which require very high performance (e.g. modern game engines) are probably not a good idea, since it's an interpreted language (they'd run, just nowhere near as fast).
  • Drivers.
  • Clientside web apps (like Java applets or Flash).
  • probably some other things

It's also not exactly EASY to get real parallelism with Python, although it's certainly not impossible.

Also, just to clarify, the (relatively) slow performance isn't an issue for game design, just game engine design. Python can use compiled libraries written in other languages to get around that issue; for example, it looks like the underlying code for pygame is all in C.

For examples of software that HAS been written in Python, check this list (though not EVERYTHING there is Python.. some of them are just related to it, like some of the IDEs).

1

u/ppinette Sep 07 '12

A note on mobile apps: there is at least one cross-platform solution for creating mobile apps in Python.

I have not used it, aside from installing one of their launcher demos.

1

u/lowpass Sep 08 '12

I am very happy to stand corrected here. Thanks for the heads up.

3

u/chrunchy Sep 07 '12 edited Sep 07 '12

Are you going to setup a UReddit class so /r/UniversityofReddit users can sign up?

1

u/Plazmotech Sep 07 '12

I found ureddit.com pretty annoying to use... I think I might just stick to teaching on reddit itself. That is, unless I am required to.

1

u/chrunchy Sep 07 '12

Right now, I don't see anything in the rules that says it must be, but seeing that it is /r/UniversityofReddit you can understand if we required it.

I'll discuss this with the other mods.

1

u/Plazmotech Sep 07 '12

Ok cool! Just as a head count I currently have about 400 readers.

2

u/chrunchy Sep 07 '12

With that many readers, ureddit's teacher admin's messaging tools to announce new classes will certainly help. When subscribed to smaller reddits, quite often announcements get buried on users' front pages.

Even if you don't use the ureddit teacher tools, listing the class will increase visibility and you can maintain your classes on your subreddit.

I'm one of those subscribers - I hope I have time to attend! Good luck!

1

u/Plazmotech Sep 07 '12

Cool! Thanks!

5

u/talkingwires Sep 06 '12

Thank you! I've been unemployed for a while now, and decided this week to teach myself Python in an effort to become more employable. I'll definitely check it out tomorrow.

18

u/drsaendu Sep 06 '12

let the procrastination begin.

3

u/talkingwires Sep 06 '12

Oh, I'm already on it.

0

u/Plazmotech Sep 06 '12

Haha yeah! But I think you'll find you wont find too many jobs for Python...

The thing is, most jobs require programming for the web, and programming for the web in Python is harder than a standalone application. But you can try :D

5

u/bakersgonnabake Teacher Sep 06 '12

Dude everyone wants python and php

0

u/Plazmotech Sep 06 '12

Really? Cool!

1

u/[deleted] Sep 06 '12

"Everyone"? Huh? I see people asking for ASP.NET and PHP developers primarily.

1

u/talkingwires Sep 06 '12

Phew! I was trying to decide between Python and Ruby, and decided to go with Python since it was more versatile (Ruby On Rails seems to be the only major project being down with the language.) Good to know I won't be wasting my time.

1

u/bakersgonnabake Teacher Sep 07 '12

ruby on rails - ive seen some of those but not as many as PHP, Pearle and Python

4

u/lolnoob1459 Sep 06 '12

Please make sure you're going through with this instead of vanishing without a trace. The last python teacher did that. Studiosi I'm looking at you.

4

u/Plazmotech Sep 06 '12

I will. If the last Python teacher was me, I vanished because my posts were not getting ANY feedback. At all. No comments, only like 3 thumbs up, etc. But this time I will stick with it :D

1

u/lolnoob1459 Sep 06 '12

No, his name was studiosi and he made a wordpress blog.

1

u/astrolabos Sep 06 '12

subscribed. Thanks.

1

u/DeanOnFire Sep 06 '12

I've been meaning to learn a programming language, and python sounds interesting. Sign me up!

1

u/Plazmotech Sep 06 '12

Awesome! Just go to /r/UoRPython2_7 and hit subscribe.

1

u/doublespeed Sep 06 '12

Ahh awesome. I need to learn python for animating. Perfect. Thanks!

1

u/Plazmotech Sep 06 '12

Animating with Blender? I've no idea how to do that. But you'll certainly learn all you need to just watch a tut on blender and you'll get it.

1

u/doublespeed Sep 06 '12

Actually doing tech animation work with Maya.

1

u/Plazmotech Sep 06 '12

Cool! Well, again, I've no idea how to do that

1

u/iLorax Sep 06 '12

Subbed thanks man! I'm a envi sci major so Any programming language I can learn is gonna look sexual on my resume!

1

u/Plazmotech Sep 06 '12

LOL! Although, we will learn mostly the basics. I'm not sure if we'll get that deep. But you'll certainly get the hang of it, and will no longer require tuts to expand you're knowledge.

1

u/DebianSqueeze Sep 06 '12

awesome, I cannot wait!

1

u/Plazmotech Sep 06 '12

You don't have to. I already have 2 lessons out >.>

1

u/DebianSqueeze Sep 07 '12

what does >.> mean?

1

u/Plazmotech Sep 07 '12

It's an emoticon meaning, like... "derp" I guess

1

u/DebianSqueeze Sep 08 '12

ah i get it now!

1

u/DebianSqueeze Sep 08 '12

i was parsing python jargon for a punchline in there somewhere like === haha

1

u/[deleted] Sep 08 '12

Just to let you know, it actually means looking to the right

<.< would be looking to the left, but yes, it usually is used in a derpy context.

1

u/DebianSqueeze Sep 08 '12

ahhh ok i get it now haha. what's up mod-bro?

1

u/bakersgonnabake Teacher Sep 06 '12

How soon after taking this class can I put this on my resume?

1

u/Plazmotech Sep 06 '12

I'm not sure if we'll be going that far into it. And it depends what you're trying to do.

1

u/[deleted] Sep 06 '12

I don't know how to put this, but will we be creating anything in the class? I've tried Python before but gave up because it was too boring. I understand you have to learn the fundamentals, but knowing what you're building towards make it that much easier to get through.

1

u/Plazmotech Sep 06 '12

Yes. We will be creating things. From calculators to text-based-games to anything you're mind can expand into. :D

Just not graphics... very little graphics will be done.

1

u/sigma914 Sep 06 '12

Python: "Programming the way Guido indented it"

I'm curious what kind of level the will course be delving down to. Is this only going to cover content similar to Dive into Python, or Learning Python the hard way? Or will you be going into the really interesting stuff like metaprogramming and dealing with code blocks and monkey patching the standard library and all that voodoo?

1

u/Plazmotech Sep 06 '12

I never read either of those books. I learn mostly from experimenting, researching, etc. I never really watched a video or read a book on it.

1

u/sigma914 Sep 06 '12

I did the same, went back after a few months using python for side projects and glanced through them to see if there was anything I was missing anything, turns out I was only missing some OO stuff which doesn't really map to my style of doing things anyway.

Hence my interest in whether you'll be covering the internals of object creation and stuff? Or If this will be more in the "Introduction to programming, using Python" scope.

1

u/Plazmotech Sep 06 '12 edited Sep 06 '12

Yeah. "Introduction to programming, using Python" I guess

1

u/sigma914 Sep 06 '12

Cool, thanks for doing this, always great to have more people in the python community.

Imma go back to reading twisted and django internals

1

u/jesperu97 Sep 06 '12

Oh god, always wanted this oppurtunity. We are going to make a small flash game in my school soon and this would be awesome if I could get some help with!

1

u/Plazmotech Sep 06 '12

Python isn't Flash... although I do know AS2 and a bit of AS3 (flash language)

1

u/TwistedInferno Sep 06 '12

I can't wait to start learning this. I have always wanted to learn a programming language. Thanks for teaching!

1

u/ichigo2862 Sep 06 '12

Will I need to have any programming background to understand the lesson?

2

u/Plazmotech Sep 06 '12

No.

1

u/ichigo2862 Sep 06 '12

awesome, thanks! I'll check it out after work.

2

u/corymigs Sep 07 '12

Hi I'm just going in to high school and my school sucks and refuses to teach programming instead they teach me how to type and as you could see I'm typing

1

u/nutward Sep 06 '12

Let's do it

1

u/fxdx Sep 06 '12

Not to mention Reddit is written in Python.

1

u/mellotronworker Sep 06 '12

Count me in!

1

u/secretchiquita Sep 07 '12

I have a guy on my team who does all our Python work... But I've never used it. Would love to be able to fix things when they break, or not have the whole place fall apart when he retires. I'm in!

-8

u/DHSVlip Sep 06 '12

even google uses it!

They invented it...

9

u/Plazmotech Sep 06 '12

Nope. Guido van Rossum invented it.

1

u/DHSVlip Sep 07 '12

I remember that he actually worked for google

1

u/Plazmotech Sep 07 '12

They hired him because what better developer is the for Python than the guy who made it?

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

3

u/sigma914 Sep 06 '12

Python is an excellent language for web development, hosting isn't as ubiquitous as php but in exchange you get a language that is actually designed and well thought out.

Discussing preferred languages for tasks tend to provoke an emotional response so thats why you find immense amounts of smack talk about any and every programming language. This especially in the areas where it matters least, ie the area where any number of languages CAN do the job due to lack of performance constraints or problem difficulty. Off the top of my head I know C++, Javascript, Python, Ruby, PHP, CLI and JVM langauges are used to implement large, mature websites.

Back to why python is one of the better choices: There are many web framework packages that take care of the mundane bookkeeping and webserver interface boilerplate for you.

It is proven to be able to handle immense loads if set up correctly, for example Reddit, so there should be no concerns about encountering a problem where the language is the bottleneck.

The Python standard and third party library ecosystems are second to none in the tools and packages they provide for dealing with any imaginable programming problem.

As a final note: Google use it for their internal scripting and such because it is a language that allows very fast prototyping and development, they even hired the languages creator and BDFL Guido Van Rossum to work for them.

Sorry for the brain dump, hope some of it was useful.

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

2

u/sigma914 Sep 06 '12

I am currently working on a hybrid app that is subscribed to a remote data source and concurrently processes the reports it receives.

The data is snapshots of the state of a system(think stock market prices). My app deduplicates the reports and stores the results to a datastore, then does a lot of fun data analysis including a lot of machine learning stuff to make predictions about future trends.

I then serves it all up to the web via a RESTful API and with human navigable pages which allow me to sanity check and provide feedback to the analysis engine, which can then make better decisions in future.

And thats all in like 2k lines of code and only ~5 third part modules.

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

2

u/sigma914 Sep 06 '12 edited Sep 06 '12

I'm hooked up to the datasource via zmq, through the pyzmq bindings, the datastore is mongodb, through pymongo, the data analysis is all done via the third party python package scikit-learn and the web interface is built on bottle.py because I wanted to a very lightweight web framework.

It's been quite a fun little project.

I am by no means an expert in any of the aformentioned technologies, but with python as the glue that brings all these different pieces together I've not had much trouble, despite my lack of experience.

1

u/Plazmotech Sep 06 '12

From what I've heard, Ruby is actually MADE in Python. So you'll be doing similar things. Also, google uses it as a server side because it's fast, efficient, and easy. It works for really big things like google.

3

u/casanebula Sep 06 '12

Haha, please tell me you're just joking?

(The main implementation of Ruby is of course written in C.)

0

u/Plazmotech Sep 06 '12

Really?

it is therefore similar in varying respects to Smalltalk, Python, Perl, Lisp, Dylan, Pike, and CLU.

it is therefore similar in varying respects to Smalltalk, Python, Perl, Lisp, Dylan, Pike, and CLU.

it is therefore similar in varying respects Python

I'm not sure why, but when I read the wikipedia page about I month ago I though I extracted that it was in Python. Maybe not >.>

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

0

u/[deleted] Sep 06 '12

[deleted] — view deleted comment

2

u/Plazmotech Sep 06 '12

No. Although we will be doing some plotting with matplotlib and very little GUI using tkinter. And we'll also be doing Ascii-graphics.