Sign in to follow this  
blewisjr

Python Video Tutorials

Recommended Posts

Hello. Recently I have been diving into python so to speak (pun intended). Since then I have decided to start doing some free python videos to help new people learn without having to plow through online texts, which can get cumbersome to read. So I have a simple question for you people at GameDev. What os would it be better to do the tutorials on. Currently I am duel booted to windows and linux. So for me either is no issue. The question really is what would be best for the learners? [edit for a spelling mistake]

Share this post


Link to post
Share on other sites
You should do them for the OS that you feel the most comfortable with. If that is Windows do them in windows and show how to setup the environment for linux. Else do it the other way around.

This method seems to work pretty well for most tutorials why should video tutorials be any different.

~Feral

Share this post


Link to post
Share on other sites
In all honesty the only reason i have windows atm is because I play eve online and my laptop won't run that on linux. when I get my new desktop built then I will convert so maybe it is better to do the tutorials on linux because I will be on linux entirely soon wish i thought about that before I posted this :P Thanks for the answer anyway lol.

Share this post


Link to post
Share on other sites
Quote:
Original post by blewisjr
Ok I am all set up to start making the tutorials. So what would you like to see first how to install python or get get into the nitty gritty.






This is for beginners....so installation and go from there......thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by blewisjr
Ok I am all set up to start making the tutorials. So what would you like to see first how to install python or get get into the nitty gritty.

Maybe you should wait until you know Python a little bit better? It would be a shame to pour a lot of time and effort into making these video tutorials, then later realize that you explained something erroneously or could have done it better. Sometimes the understanding of things you had early in your programming career can be wince-inducing later on.

It's up to you, though.

Share this post


Link to post
Share on other sites
Don't worry Oluseyi I do have quite a few years of programming experience under my belt. At this point to me a language is nothing but a change in syntax. I may have taught myself quite a bit since when I started programming at age 12 now 21 and have become a college dropout after 3yrs of going to school for Information Systems and Technology (IST). This does not make me incompetent I hope :D. At this point in my life I am getting ready to go back to school for computer network systems and hopefully landing a job in the games industry eventually coding backend server systems for games. Already working on my portfolio using Python.

Python is a great language that I fell in love with quick. I would like to share my knowledge of programming to the masses of people who would like to start to learn but hate having their nose in some online book like Dive into Python. I am putting a lot of thought and energy into these tutorials to make sure they are of good quality and useful to the learner.

The real purpose of my last question was more of a should I expect them to know how to find python and install it. I guess it does not hurt to assume they don't.
If that is the case I might as well give them a quick command line lesson so they know how to navigate to the folder so they can run the code.

Share this post


Link to post
Share on other sites
Well I'm pretty good with C++, Java, and BASIC but I still don't really get what my python programs should look like. It almost punishes you for doing things how you normally would in these other languages.

But if you have a knack for languages, I will consider watching some of the non-beginner tutorials.

Share this post


Link to post
Share on other sites
What about that statement scares you. Programming concepts are programming concepts no matter what language you use. The only thing that changes is the syntax.

Now as for the tutorials. I have been having some issues with linux with screencasting. Turns out the screen recorder that works the best is almost impossible to edit unless you convert it to a avi. The issue with that is the quality takes a huge hit. There is a editor that edits video format the recorder uses, however, it does not run properly on my laptop. So because of this and because I want the screencasts to be clean, readable, and in all honesty useable I will be doing the tuts under windows. Damn my laptops hardware.

Share this post


Link to post
Share on other sites
Quote:
Original post by thedustbustr
Quote:
Don't worry Oluseyi I do have quite a few years of programming experience under my belt. At this point to me a language is nothing but a change in syntax.

This statement scares me.

It shouldn't. Programming languages expose overlapping subsets of the same set of principles/concepts. The differences are syntactic and idiomatic. For instance, Boder's complaint about Python penalizing him for doing things as he would in other languages is an instance of idiomatic difference.

@blewisjr:
Cool. Hope you work out your software issues soon.

Share this post


Link to post
Share on other sites
Quote:
Original post by Boder
Well I'm pretty good with C++, Java, and BASIC but I still don't really get what my python programs should look like. It almost punishes you for doing things how you normally would in these other languages.


It should look natural and not brain-damaged. I say that as an experienced C++ and Java programmer whose first language was BASIC and whose most recently learned serious language is Python.

Think at a higher level of abstraction: i.e. about what you are actually trying to do. If you've been sent a bunch of random objects and asked to make a clay model of each of them and send the models back, how would you do it?

Approach 1: Arrange the models on the ground, equally spaced - let's say 1 metre apart. Count them, and write the count on a red piece of paper. Write the number zero on a white piece of paper. Repeatedly, check if the number on the white paper matches the number on the red paper (this means you are done); if they don't match, walk x-many metres down the line (where x comes from the number on the white piece of paper), make a clay model of the object you find there, and increment the number written on the white piece of paper.

Approach 2: Grab an object, make a clay model of it, and put it aside. Keep going until you run out of models.

Approach 3: Arrange the models on the ground, equally spaced - let's say 1 metre apart. Count them, and write all the numbers from 0 up to N - 1 on each page of a stack of paper. Repeatedly, grab a piece of paper and read the number off of it. Walk x-many metres down the line (where x comes from the number on the white piece of paper), and make a clay model of the object you find there. Keep going until you run out of paper.

Now, suppose you had to explain to someone how to do it. What would you say? You might outline any of the above approaches, but you probably would just say "give me a clay model of each of these things". I'll label that Approach 4.

In Python, Approach 3 is the closest you can get to Approach 1. It sounds retarded, and seems inefficient, because you're accustomed to not having to waste a huge stack of paper for such a "simple" task. But really, you simply haven't been thinking about how retarded Approach 1 is.

In C++, you can describe Approach 4 more or less, but somehow any attempt to do so always results in you sounding like you have a really bizarre accent. Approach 2 is more reasonable, but lots of people ignore the easy ways of doing things. And somehow it never seems to save *that* much speaking effort when you do try to explain things the simple way.

So, let's see that in code (I'm going to ignore the extra complication that returning a std::vector by value in C++ will make many people gag and worry about efficiency):

std::vector<ClayModel> makeModels1(const std::vector<Object>& objects) {
// Although actually, programmers doing things this way might not even
// know about std::vector, or may carry some bizarre distrust of it...
std::vector<ClayModel> result(objects.size());
for (int i = 0; i < objects.size(); ++i) {
result[i] = modelOf(objects[i]);
}
return result;
}

std::vector<ClayModel> makeModels2(const std::vector<Object>& objects) {
std::vector<ClayModel> result;
for (std::vector<Object>::iterator it = objects.begin(); it < objects.end(); ++it) {
result.push_back(modelOf(*it));
}
return result;
}

std::vector<ClayModel> makeModels3(const std::vector<Object>& objects) {
// O_O
std::vector<int> indices = make_indices(objects);
// The original STL provided a function 'std::iota' that was useful for
// doing that, but it didn't make the cut for the C++ standard library.
std::vector<ClayModel> result(objects.size());
for (std::vector<int>::iterator it = indices.begin(); it < indices.end(); ++it) {
result[i] = modelOf(objects[*it]);
}
return result;
}

// Even in "approach 4", we need a named 'result' variable...
std::vector<ClayModel> makeModels2(const std::vector<Object>& objects) {
std::vector<ClayModel> result;
std::transform(objects.begin(), objects.end(), std::back_inserter(result), &modelOf);
return result;
}



And in Python:


def makeModels1(objects):
raise NotImplementedError, "ZOMG I haet Python >:[" # lol?

def makeModels2(objects):
# Lots of people do this, even once they've learned to avoid approach 3,
# and I consider this a sign of lingering C++/Java/etc. brain damage.
result = []
for object in objects:
result.append(modelOf(object))
return result

def makeModels3(objects):
result = []
for index in range(len(objects)): # widely considered very unpythonic
# At least we can use a temporary for the indices...
result.append(modelOf(objects[index]))
return result

def makeModels4(objects):
# look ma, no temps! Pure expression -> pure expressivity.
return [modelOf(object) for object in objects]






Now, this must sound to a lot of you like a thinly veiled argument for functional programming languages. But Python is at least as multi-paradigm as C++ is. It just happens to derive its FP support from a natural syntax instead of a library built on an "iterator" concept. Then again, Python does have an iterator concept (it's just one you don't often have to deal with at a low level) and plenty of support for non-FP things. In short, it's designed to let you use the best tool for each sub-job of your program.

Sure, the hammer isn't balanced like you're used to, but you have a full set of heads for the screwdriver now.

Happy hacking.

Share this post


Link to post
Share on other sites
Yeah, mine would be makeModels2 in Python. But I don't actually think about the approaches like that, in such real-world terms.

Then I might say how ugly my code is, read some tutorials and finally go "WOW, you can do THAT!"

I think the problem is I never really went through all the tutorials, I just treated it like a syntax change, like C# or something.

Share this post


Link to post
Share on other sites
Ok software issues are sorted next I will be testing the hosting quality. On the host I want to use it converts the formats to flash. So hopefully it will not kill the quality if it does not you will see a perty announcement later tonight.

Share this post


Link to post
Share on other sites
[LOL] I'm so proud of this code:

def readData():
data = list()
try:
while True:
text = raw_input()
data.append(text.split())
except EOFError:
pass
for i in range(len(data)):
for j in range(len(data[i])):
data[i][j] = float(data[i][j])
return data

Share this post


Link to post
Share on other sites
Everything is great and in working order. I will be putting out the first tutorial tonight I will make a separate post for all the information etc... i will also include instructions on downloading and playing the file.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this