• We are currently performing site maintenance, parts of civfanatics are currently offline, but will come back online in the coming days. For more updates please see here.

Python Newbz0r

Joined
Oct 26, 2005
Messages
4,857
Location
Kansas City, MO
ANyone know of a good place for someone who knows no Python begin to learn it? I am pretty sure I have the Python.exe program. If not, I remember where to get it. I just need a place to go to learn how to use it. I don't have time to search right now but I probably will later. Any additional info you want to throw at me would be greatly appreciated.

Thanks.
 
King Flevance said:
ANyone know of a good place for someone who knows no Python begin to learn it? I am pretty sure I have the Python.exe program. If not, I remember where to get it. I just need a place to go to learn how to use it. I don't have time to search right now but I probably will later. Any additional info you want to throw at me would be greatly appreciated.

Thanks.
I found Dive into Python to be helpful.

To get python itself, go to http://www.python.org. It also has docs and links to alot of good modules. (You probably want to stick with 2.4 as that is what Civ4 uses.)

Good luck. :)
 
I would also recommend just starting the IDLE program that comes with the standard windows install of Python, as that provides a windows friendly command prompt where you can simply type in python commands to see what they do:

Code:
IDLE 1.1.3      
[COLOR="DarkRed"]>>>[/COLOR] 3 * 4
[COLOR="Blue"]12[/COLOR]
[COLOR="DarkRed"]>>>[/COLOR] [COLOR="Orange"]print[/COLOR] [COLOR="Green"]"check this out"[/COLOR][6:10]
[COLOR="Blue"]this[/COLOR]
[COLOR="DarkRed"]>>>[/COLOR] [COLOR="Orange"]def[/COLOR] [COLOR="Blue"]RunIt[/COLOR]():
	[COLOR="Orange"]print[/COLOR] [COLOR="Green"]"I've been run!"[/COLOR]

[COLOR="DarkRed"]>>>[/COLOR] RunIt()
[COLOR="Blue"]I've been run![/COLOR]
[COLOR="DarkRed"]>>>[/COLOR]
 
It's also useful because, unlike the basic command-line python program, it provides syntax highlighting as well as tooltips to help you with function arguments and class/module members.
 
Having worked with almost a dozen different computer-based languages and having learned five verbal languages, I feel I can safely say that python is among the easiest computer languages to learn. It is much more straight-forward than C/++ and less verbose than C#/VBN/Java. The fact that it's interpreted makes it very easy to debug.

I use it pretty much whenever I have the choice over which language to use
 
Back
Top Bottom