Going to do a little programming learning in the upcoming while using: http://tech.yipit.com/2012/08/21/how-i-taught-myself-to-code-in-8-weeks/ as a guide.
I’ve never been a particularly technical person (in my opinion) which was part of the reason I felt that this was worth my time to make. Artists should understand some of the technical tools available to them, and I’ve seen enough people asking for python knowledge that I figure it’s about time that I adopt it into my repertoire.
I’ve got a bit of time on my hands at the moment while I’m on sabbatical… so, I figure I should put it to use for more than just working on my indie game (which I am not doing any of the programming for).
I’ve made attempts to learn Python in the past, but honestly haven’t found a reason to implement it professionally as I’ve found HScript to be more efficient than any Python scripts I’ve seen at work… but lets see if I can push myself to retain some knowledge this time around 🙂
I’ll be starting with http://learnpythonthehardway.org/ and will be going at both a quick and slow pace. The first link I have up top suggests doing stuff in a weekend… I’m going to go slower… I’ll probably limit myself to about 6 exercises a day and tackle it every day. This lets me continue to focus on other things with my time, and hopefully to build up some gradual long term memory of this stuff rather than cramming and forgetting like I’ve done in the past.
- -believe it or not, I didn’t know I had a shell other than the command line in Windows. I’ve installed cygwin in the past, but since this lets me use a native program I shall indeed be using it.
- -was able to remember how to mkdir from previous linux usage, so was able to get through the steps without looking at the “What You Should See” section. It was a relief to see that section afterward though. At least I know I’ll be able to get through the rest of the stuff without googling stuff I don’t already know.
- -navigation works as I remember: ls, and cd. I seem to recall the command line in Windows behaving differently than this.
- -having to use alt + space to get to the menu seems foolish. I prefer the ability to use the mouse to copy and paste in linux.
- -For future reference, when creating a new item from the shell, you can type: New-Item .new_file.txt -type file
Exercise 1: A Good First Program
- -I’ve done hello world before using the Dive Into Python book, so this also isn’t new territory.
- -” or “” can be used depending on what you want to be printed inside the parsed text
Exercise 2: Comments And Pound Characters
- -People that don’t comment their code should be shot.
- -This is not new for me either.
- -hmm… I take that back. I can’t recall how to work with floating point numbers
- –http://mail.python.org/pipermail/tutor/2011-June/084066.html
- -Maybe the reason I don’t remember is that I’ve tried to learn using python 3 in the past, which uses float by default instead of int. I guess it’s worth keeping in mind that that is a difference between Python 2 and 3.
- -Ah.. he mentions in the last Student Question that you can use 7.0 / 4.0 so there ya go.
Exercise 4: Variables and Names
- -for some reason python makes me uneasy. I like “;” to finish lines of code…
Exercise 5: More Variables and Printing
- -Now this is actually quite strange to me. I get it.. but it seems silly to add the variables mid sentence in the %d or %s format, and then have to list all the stuff in sequence at the end. Seems cluttered in the event that you may need to insert or remove a variable or change stuff down the road. I wonder if there’s a more efficient way to do this?
- -http://ff6.ocremix.org/ is keeping me entertained.
- –http://docs.python.org/2/library/stdtypes.html#string-formatting-operations seems to be the list of “Conversion Types” which I’m assuming is the same as the list of “Python format characters” that would include things such as %d for signed decimals, and %s for strings.
- -Alright, so there are a couple of things here that give me pause
- -The first is the way it illustrates a ‘ on either side of a string that is called as a variable. I suppose the point is that %r returns raw information which should include the quotation marks… whereas %s just returns the string… should we want quotes, we have to add them manually.
- -The second is the way we use %r in the joke_evaluation to print the hilarious variable. I get it, but it’s a little quirky encountering it the first time.
And that’s it for today! Note I’ve re-enabled comments to my site… so feel free to say hello!