Added: 2 years ago
From: thenewboston
Views: 66,319
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (162)

Sign In or Sign Up now to post a comment!
  • for some reason keep getting this

    AttributeError: cn instance has no attribute 'dn' please help

  • I hope no one sees me watching this... -.-

  • Python 3 adds (self) automatically so it's just funny how he stresses the importance of it :) This is the case atleast on Eclipse with Pydev.

  • great tutorial! makes me less intimidated to try to program in object oriented after getting so used to structured programming.

  • This is the first time I've been really confused in python.

  • @cvs333 Why are you confused? It is quite clear I think. Rewatch and try it out couple of times. It's really easy.

  • @Nikotiini69 Same with cvs333. I don't get it; what is the purpose of classes? What do they do?

  • @ all the people who have been having the problem when they get to first.displayname() after you enter self.name=name, when your creating the class, when you return hit your left direction arrow and it will align the methods your making and should fix your problem if this makes sense and fixes your problem thumbs up so others can see

  • @TheNanoStuff I got the same problem, the problem is you're not putting in the empty (), hope this helps!

  • make sure you have ' name = "" ' after the 'class className:' statement

  • don't understand... and how do I do the 'saying' in python 3?

  • I keep doing exactly what you did, but for some reason I keep getting an error message whenever I try to use displayName or saying that says saying something about a bound method

  • I like how you sets the names for example the class. Makes it a whole lot easier to understand. Great work man! keep it up

  • Damn. Just looking at this in the Python textbook I bought, it would've taken AT LEAST a month to figure out. Thanks bro. 33 videos in one day. Tomorrow is a review of those 33, then moving forward. Someone should be paying you. Just sayin'.

  • You've just cleared up days of frustrating research in only 7 mins. Great explanation! Subscribed!

  • YES! I finally understand how classes work!! I love you.

  • more examples on class & self, please

  • This is getting hard for somebody who doesn't speak english natively :P, but i can follow it. Thanks for the great tutorials, all of them.

  • Bucky4pres!

  • Thanks for the tutorial!!! really helped :)

  • Thanks for the tutorials man. This will surely help me out for my class at UT

  • Holy crap this is eating my hard drive space!

  • Awesome tut's keep up the good work.

  • 6:01 FIRST FIRST FIRST!!!! Oh damn...I am 51915th....

    sorry....

  • I would have put these tutorials in a different order

  • Can you have a function within a function?

  • @Dragalug technically yes...why not try it out youself? Be warned, it might be a recursion depending on exactly what it calls on.

  • @Dragalug You can of course call a function from another function. But I don't think it is possible to define a function from inside another function. After all, it is quite impractical. Why would you want to define a func. inside another function. Instead, you could, define it outside the function and call it inside the function. It gives the same result and is much more efficient and easier to read. Moreover now, you can also use it in any other place without calling the original func. HTH!!!!

  • for everyone that doesnt know yet, self has no special meaning to python, you can use "banana" to, but its a convention to use self. Self is there because when you activate a class by assigning it to a varialbe, that variable becomes an object and is passed as the first argument for every function in the class. thats y you have to start everything with self.

  • which tut is on files...playing with em and they are troublesome

  • good job, you always know what the audience is thinking

  • The best

  • Best tutorials on the net.

  • I LOVE YOU SO FREAKIN MUCH.

  • Bucky your the best teacher in the simplest form. I spent 4 months in class and I learn crap!!!! I spent 1hr watching your tutorial series and learn it 10x better than I did in class thanx bro man your the best!!

  • 'self' is like saying 'this' in java or c++, maybe it helps

  • let me resay that. If you have power over the computer, you can make ANYTHING and i mean ABSOLUTELY ANYTHING possible in the little dream world i like to call the virtual space that is not really existant but changes lives. If anyone understands that, give it a thumbs up lol.

  • @louisrocks40 exactly, that's why I am so addicted to computers for 8 years now.

  • @louisrocks40 Yeah, but there are probably limits to the quality of gpus and cpus due to heat. This would limit what you could do with code.

  • @louisrocks40 you mean Minecraft? LOL

  • I hope you live a long and happy, healthy life! You have helped everyone achieve their dreams.

  • I can not thank you enough. I have been trying to learn classes for the longest time and FINALLY I freaking understand them. Thanks SO much.

  • Thanks a lot

    

  • jus took a bunch of notes off of this to help me on my python Final lol Thank you~~!!!

  • 6:00 reminds me of the average youtube commenter.

  • Soo, if "self" is used as a reference to the object you just created, then there must be something else like "public" or "static" that refers to the class, or in other words, all of the objects? That is so awesome!

  • Great!!! God bless you!

  • Self  self self self self

    First first first first first

    That tutorial wasn't confusing at all!

  • Thank you bro

  • FUCKIN THANK YOU BROO!!!!!!1

  • 6:00 That's exactly how the first 10 comments are on all YouTube videos :)

  • @ReDespawn I dont get it

  • so the 'self' parameter can be called anything since its just a variable for the object right? Couldn't I just use something like createName(obj,name) instead of createName(self,name)?

  • Thaks very much for your explanations in OOP using Python. You made my learning process much easier. Thanks very much indeed.

  • What is the difference between:

    def example1:

    print ("hello")

    and

    def example2:

    return ("hello")

    They seem like the same thing...

  • @CwisyLiu If you would use it in a separate function, for example, the first one would just print hello out and the main program wouldn't see it (it would just appear on the screen). The second case you mentioned wouldn't display it on the screen (in a real program, not Python GUI), but the main program would get that value and could use it in further functions or whatever... This sounds complicated but with some practice in programming it should be a snap :)

  • @CwisyLiu the print keyword prints out what you put in its parameters, so

    print("hello")

    'hello'

    the return keyword returns a value from the method, so

    def returnHello: return("Hello")

    x = returnHello()

    print x

    'Hello'

  • When your first watch these tutorials you think ("OH no not another tutorial series on programming\n") but then your like im.impressedWith(this) lol this guy should be a professor better then alot of real teachers I have had

  • You are awesome. I've tried 3 other tutorials and couldn't understand how the #$%in ".self" thing works. Only after your explanation did it finally start to make sense.

    you should be a college professor for python!!

  • I think you made a confusing mistake @3:49. The "name" in self.name doesn't get bound to the argument "name" of the createName method, so you don't end up with first.bucky="bucky", it's still self.name. it would probably be less confusing to make the argument name differ from the attribute name being set.

    You sort of corrected yourself, but not until 6:55... in case anyone else was confused by that.

  • Nice tutorial i have been reading on objects for the last week and yours was by far the most helpful. much respect!!!

  • Oh my god!! I got it ALL AT ONCE at 6:39 lol i have no idea why. THANKS bucky, i subbed, u totally deserve it.

  • you forgot to mention about putting parenthesis around the:  "hello %s" % self.name

  • @TheMedic1231 he's on a 2.x version of python. you're on a 3.x he doesn't need them

  • @TheMedic1231 Actually, print ("hi") and print "hi" works same.

  • Bucky is a legend, best python tutorials on the web. i just hope they keep on comming

  • This should be a TV show;

    PROGRAMMING IN PLAIN ENGLISH!

  • @xero907 i don't think so

  • @ThePokemonteacher Erm... I don't learn Python anymore...

  • @mcfluffier

    its a placeholder for a string (%s for string i think its %d for an integer) so u write %s in the text u want to print out and after the string u put % and then the name of the string u want to use in this case self.name

  • I dont quite get it :(

  • i understand everything but the "%s" what does it mean

  • @mcfluffier

    just a placeholder or a mark for the print method that instead of the %s will stand the value of a variable...

  • these tutorials are amazing! please make more!

  • Can't wait till I get to the pygame tutorials.

  • I would like things to do for my self. Like an exercise to create something thats fun and works

  • wayy tttooo fast

  • fuck i dont get it ima watch it one hundred more times lolz

    oo ok im getting there remeber first = classname

    which makes first(same as classname).displayname(ur just displaing the name u put one the createname)

    im i right?

  • fuck i dont get it ima watch it one hundred more times lolz

  • I wish i knew you in person! best tuts on the web

  • THINK GLOBALLY: ACT WITHIN LOCAL VARIABLE SCOPE

  • thank you !

  • i didnt get this :|

  • Self, self, self self self.

  • so that means in python you declare an variable at the time you use it:

    'self.name = name'

    so 'name' is the local variable of the function 'def createName(self,name):'

    and the 'name' in 'self.name' is the variable for the whole class defined in a function by using it.

    am i right?

  • @ForAncelot no i think self.name is the variabe and name is the value

  • Can you call the variables/attributes from other methods and use them in different methods of the class or do they work like local variables like in C++

  • thanks dude you Make OOP look so easy

  • Wow, u are amazing. I have been looking all over online trying to learn what classes meant and what they are used for. Your tuts 32 & 33 totally just made it click for me. You da man.

  • @Cigotie

    me too dude. none of the resources i've been using have been clearer than bucky's series

  • Wow! It all became super clear in the last 2 minutes! Your vids are nothing short of awesome; You could teach a ten year old to do this stuff!

  • Create a class... Stopping power is a must!

    j/k Nice tutorials Bucky :D

  • Well when iam trying to run this program in PyScripter Text Editor it is giving an

    exceptions.

    " TypeError: unbound method createName() must be called with Person instance as first argument (got str instance instead) "

    here i have created class as Person but when i run in Python shell then no exceptions ?

    Could you tell me Why this so?

  • thanks man, i can use objects to create players for a simple python game. :D

  • If you dont understand this you will NEEEEEEEEEEEEEEEEEEEEEEEVEER IN YOUR LIFE UNDERSTAND pihton lol

  • thanks bucky, I had problems understanding this, but now I get it!

  • I Love your tutorials. I was familiar with Python, but your tutorials were really helpful in clearing some of my doubts. I really appreciate your patience in making these tutorials. :)

  • alright, fine, i give up. you win.

    gotta keep the pot heads weeded out i suppose

  • I Kind... Of Understand..

    It is a little hard though so I'm gonna look at your next tutorials and hopefully it will clear my mind of worries :D

  • if the creator of python just go a little bit further to avoid typing 'self' each time...

  • thanks merci شكرا

  • thanks, self was bugging me :D

  • This is making no sense to me, I did the exact same thing as you did, I even checked 7 times. and it says I have some error...

  • @hudacheck What version of Python are you using?

    And what is the error?

  • Its Not Working For Me

  • Brilliant stuff Bucky! You make programming very easy and I am loving it.

  • thanks man great tut

  • YAY!!! i get it...

  • thanks Bucky, I'm 17 years old and im teaching myself from home, so yea it's a pain in the ass but you made it a lot easier, thanks.

  • @sekulr believe me its better to learn most programming languages from home than at school.

  • :P why do you think that? i kind of want a teacher, i have soooo many questions :P

  • @sekulr most of your teachers wont know shit and will be reading by the book.

  • @louismarcil ehh ill find someone who does know :P

  • Thanks man, I understand things much more easily coming from you than my college professors. I will most likely be watching many more of your tutorials.

  • Hi, Thank you for the classes..are very good..

    I have a question for you, do you know if visual studio supports python? also if python nterfaces with API of windows with forms or similar ..I see that python is very easy to work compared with #c and #c++..thank you..PJ

  • Great videos. I needed to learn Python for a school science project, and this series got me up to snuff SUPER quickly. You are awesome. :)

  • but I thought objects needed to inherit the object class

  • @supergenius1994

    They are not required, but yes they can if you want to include all from others class. Still whatever you define for objects inside your class will overwrite values from inherritated class if they confront.

  • great man..u r doing it for free!!!!!!!!!!!!!!!

  • @amarnathalapati

    you can go to his website and make a donation

  • Thanks man that totally made sense. I Appreciate these videos.

  • So anytime you create a method within a class, the self is a temporary substitute for an object.

  • class warlock: def sep(self,sp): self.sp=sp def spellpower(self): return self.sp def haste(self): print "%s is here to save the fing day" %s self.sp

    i cant figure out what im doing wrong with the self

  • your last line needs to be:

    print % is here to save the fing day" % self.sp

    if you look at yours you put %s instead of %

  • idk if i missed a tutorial, but whats the %s?

    i know its a variable but which one?

    im confused =|

  • it means you love vagina! %s

    % stands for vagina.

    s =hell yes....

  • @pimpmobile999 it is used to print out a string or other value from a variable, particularly in a printed message. Which means that it's not necessarily a variable, but a way for a result to be printed as part of a message.

  • does any one know how to pass numerical values between classes ???

  • Almost there... 10 more left!

  • nice

  • I didn't get everything, but when you explained it at the end of the tutorial everything got more clear....

    PS: KeeP tHe gOoD wOrK!

  • Its strange that you can create an object variable inside a method.. I mean, you didn't define "name" as a variable in the class, but you can assign it in a method.. hmm, that's very weird, I wonder why they made it like that.

  • how come he passed only one parameter to the method first.createName() when the method needs 2 parameters (self and name)?

  • self's the class "itself". if you create an object, the object actually takes over everything what is "self" in the class. that's why you don't have to pass 2 parameters...

  • very nice tutorial!

    you know how to explain complicated stuff for the newbies to understand!

  • I like your style, you do a great job of walking us through the process of coding python. thanks great job.

  • This is actually really helpful.

    I will be posting my python projects on my blog :)

    CodeJustin(.)com

  • good stuff

  • how many of these are u gunna make lol :)

  • 800

  • you going to put these python tuts in a 'youtube playlist' anytime soon?

  • it will help them rank higher on youtube search index btw.

  • whao are you really well thats kool keep up the good work

  • awesome keep'em coming. Do some socket programming!

  • @thenewboston bad ass that awesome! can't wait. thanks for the great tutorials man.

  • @thenewboston aww, it's not over 9000.

  • @thenewboston actually, you have now 950 tutorials! Long Live Bucky (we want more)!

  • @homeboy1004 over 9000!

  • I WANT TO KNOW HOW TO GAME DEVELOP :D

  • Pygame,....and follow the links!....and stay away from MS!.

  • LOL :D

  • DAMMIT I'm so jealous hahahahaha ur stupid

  • who cares

  • you care... you comment

  • Yea totally im just pointing out that your stupid

    or do i really care

    maybe the jealously burns up in my soul and wants to kill the next think i see yea i think i care

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more