The Python Walkthrough Thread

Associate
OP
Joined
2 Nov 2005
Posts
931
Location
Leicester
Updated the OP. Hope to see some current members return since the majority of people are on Phase Two, Four (and beyond) might have to start without them if they don't come back. New folk are still welcome to sign up, reply to register your interest.

I am currently on holiday for the week, so next tutorials will be a couple weeks away at least.
 
Last edited:
Soldato
Joined
18 Aug 2011
Posts
2,853
Location
Norfolk
Phase One: Figure out who wants to take part! Reply to register your interest.
Phase Two (Post #21): Get people set up with the relevant software. Make sure everyone is set up before going onto next phase.
Phase Three: Teach basic syntax of python using simple examples, while explaining each example

So your working on Phase Three I guess? And your forward to Four?

Edit: keep me informed of your progress! Also for others reading this, I am interested in seeing some people complete phase three, put in a reply to let me know you have started on it :)

Yes:)

Have not had the chance to finish phase 3 yet.

Happy to play catch up.
 
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
Phase 3 complete although I don't really understand the classes.

Some times its hard to understand something until you see it in practice. I've learnt the basics of several languages and some concepts are a little hard to grasp until you've used them.

Don't worry too much about it for now, it'll become clear when you are using them :)
 
Associate
Joined
22 Nov 2007
Posts
1,662
Location
Staffordshire
Some times its hard to understand something until you see it in practice. I've learnt the basics of several languages and some concepts are a little hard to grasp until you've used them.

Don't worry too much about it for now, it'll become clear when you are using them :)

I found everything in phase 3 easy to understand, its just the classes went straight over my head. I will do some more reading over the next couple of days to see if I can get my head round it.
 
Associate
Joined
25 Feb 2007
Posts
905
Location
Midlands
Completed Phase 3

I found everything in phase 3 easy to understand, its just the classes went straight over my head. I will do some more reading over the next couple of days to see if I can get my head round it.

One of the best explanations of a class that I've ever seen is to think of them as 'things' in the real world.

An example of a 'thing' could be a person, which has attributes (variables) such as age, weight, height etc. but also actions (methods) such as eat food, go to work etc.

Another example of a 'thing' could be a car, with attributes of make, model, colour, top speed and actions of accelerate, brake etc.

It's basically, as Rich said, a container for a number of related bits which an easily be referenced later on in your code. So every 'person' in your code would have the variables and methods above, and the same with each 'car'.

I hope that helps and doesn't confuse you more :D
 
Soldato
Joined
30 Dec 2004
Posts
2,869
Location
Stoke-on-Trent
Is it too late to join in? I'm trying to work my way through various books for programming and this looks a nice gentle way in.

edit : I'm trying to roll in ObjC as well as I have an iOS app idea I want to do but no friggin idea on coding - I have very basic VB skills and the last programming I did was assembler on ZX81 :o
 
Last edited:
Soldato
Joined
6 Mar 2008
Posts
10,079
Location
Stoke area
nah, it's not too late. Rich will add your name to the main post, all you need to do is work your way through the tutorials (3 parts now) and say when each one is done.
 
Soldato
Joined
14 Apr 2009
Posts
4,329
Location
Location: Location
Hey all, I'm a bit late to this but hope I can still join :)

I've done all three phases, I'm a bit stuck on the classes though. Getting an error message:

datacls = mycls("hello world")
TypeError: this constructor takes no arguments

Not sure what I've done! I kind of understand the theory of classes but they always confuse me when I start using them.
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,325
Location
Derbyshire
I've done all three phases, I'm a bit stuck on the classes though. Getting an error message:

datacls = mycls("hello world")
TypeError: this constructor takes no arguments

Not sure what I've done! I kind of understand the theory of classes but they always confuse me when I start using them.

It's saying that you don't have a constructor (I.e., the method which is executed when the class is initialised where you can do various set-up bits) for your mycls class which accepts parameters (the "hello world" bit).

As standard classes don't take arguments, you have to add your own method to extend it in this way.

Which makes me wonder, have you got this line in your class definition?

Code:
def __init__(self, data):

and are you using double underscores rather than just one?

Without it, your mycls object will just be using its standard constructor which is why it's breaking.


(the above is true for C# anyway :p)
 
Back
Top Bottom