A few days ago I decided that I wanted to try to learn Python. Knowing that the xkcd guy likes Python I figured I'd scout out his forum for any suggestions on how to start. One thing I came across was the idea to start a weblog (I hate the word blog) about my experience learning Python. Of course this suggestion was to someone who had no experience in any programming languages which sounds like it would make a really good read. I figured that I would try it out anyways even though I do have some experience in other programming languages.
Anyway, I searched Google for recommendations for a compiler and where to start. I found that I needed to download the Python language which is mostly unfamiliar to me. That felt like this was going to turn into the whole ordeal with trying to learn Java which was kind of a nightmare for me at the time. Then I downloaded Eclipse which appears to be an editor made for multiple types of languages but for Python you need an ad-don which was called PyDev. Getting PyDev installed on Eclipse was a little confusing but the website had a very good walk-through.
The Hello World program was delightfully easy with just print("Hello World!") as the program. I looked through tutorials on the basics. Lots of stuff is rather different than I am used to. Lately I've been trying to make a simple program that can find all prime numbers out to some point. One million seems like a good number. For loops were confusing the hell out of me. This range stuff is different than I'm used to and I don't know if I can get the counter to increment more than one number at a time (I'll want to skip evens for finding primes). I am also encountering problems with the math. I need to divide two numbers and I am guessing that the result is rounding to a whole number. I'll use the print function to see whats going on in the code but for now my time has almost run out for tonight.
Python: http://www.python.org/download/
Eclipse: http://www.eclipse.org/downloads/
PyDev: http://pydev.org/download.html (read the tutorial on updates)
Documentation: http://docs.python.org/tutorial/ (Looks to be more detailed)
NonProgrammers Intro Guide: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers (I haven't used this but sounds useful for anyone new to programming)
Programmers Intro Guide: http://en.wikibooks.org/wiki/Python_Programming (I've been using this for quick tips. The exercises have been very helpful)
For those of you who are interested about my programming history, I've been programming on and off since I was maybe thirteen or fourteen. When I first started I was really messing around with QBasic on an old 386 that no one in my family cared about. I didn't know what programming was at the time but I read through the programming code and could make a bit of sense with it. I alter the code and learned from it, then using that making my own programs. I ended my experimentations with that after a made a short semi-graphical RPG with the sprites I had to write myself. The game had a bug that frustrated me too much since I couldn't fix it. I later found my mistake. The whole thing was written with goto statements :(.
Later my friend and I starting making a few websites here and there. I ended up becoming friends with a girl who had a weblog and I had a lot of fun reading through it. At the time I didn't know what a weblog was but I wanted one myself. I rented some web-hosting services from some company that supported PHP and MySQL and learned them to program my own weblog. When I that I told the girl and she told me that she just got her weblog from livejournal. Blast, all that work for nothing and it costs me 60 dollars a month. Later in highschool I took a pascal class and had fun with that.
Later in college I took some classes for C/C++, Java (didn't learn a thing. Fucking online classes), Flash programming, and finally ended with a micro-controller programming class which used C and was a blast. I've always wanted to do some game programming/development and hope that someday I can get skilled enough to do that, until then I'm just trying to learn what I can. Since the micro-controller programming course I've really enjoyed looking into more micro-controllers and electronics, perhaps I'll start working more for that as well.

range() has a "step" argument that you can use to make it increment by something other than 1 each time. For more info, see http://docs.python.org/library/functions.html#range
ReplyDelete