Python Programming and its usefullness

I’m learning how to be proficient with most of the features in Blender because 3D Modeling and artistry is my future career. But I was wondering, how useful would Python be to me if I learned it also. I know I could. It would take a bit of time, but with a couple of books and some projects I’m sure I could get the hang of it. But I don’t want to waste the time learning it if there it is going to prove to be of no use to me. So what do you guys thing? With my projected line of work, or just as a side thing, would Python be worth it to learn?

From my simple perspective (amateur and medium level 3D modeller and low level python coding) I think learning Python is always good. It will give you an understanding of how programs work, how modelling tools works and be able to automate things. Python can be used in more places than just Blender. Also (if you get good enough that is) you can improve your work-flow with Python (being it by automating things, new tools or improving other peoples tools), which might give you that edge above the other modellers.


You have just about got me convinced ;). But I would like to know some of the other places I can use Python.

I wrote some stuff, but wiki beat me to it. :slight_smile:

Python is often used as a scripting language for web applications, e.g. via mod_python for the Apache web server. With Web Server Gateway Interface a standard API has been developed to facilitate these applications. Web application frameworks or application servers like web2py, Zope, and Django support developers in the design and maintenance of complex applications.

Python has seen extensive use in the information security industry, including in exploit development.[24] Python has been successfully embedded in a number of software products as a scripting language, including in finite element method software such as Abaqus, 3D animation packages such as Maya, Softimage XSI, modo, and Blender, and 2D imaging programs like GIMP, Inkscape, Scribus, and Paint Shop Pro.[25] ESRI is now promoting Python as the best choice for writing scripts in ArcGIS.[26] It has even been used in several videogames.[27]

For many operating systems, Python is a standard component; it ships with most Linux distributions, with NetBSD, and OpenBSD, and with Mac OS X. Red Hat Linux and Fedora both use the pythonic Anaconda installer. Gentoo Linux uses Python in its package management system, Portage, and the standard tool to access it, emerge. Pardus uses it for administration and during system boot.[28]

Among the users of Python are YouTube[29] and the original BitTorrent client.[30] Large organizations that make use of Python include Google,[31] Yahoo!,[32] CERN,[33], NASA,[34] and ITA.[35] Most of the Sugar software for the One Laptop Per Child XO, now developed at Sugar Labs, is written in Python.[36]

Ok well then I will pick it up as soon as I finish my Blender for Dummies book and some of the more advanced features of it then I will go and pick up a nice book on Python Programming :wink:

Do you have any previous programming experience? If so, Python will be a breeze.
If not, Python is probably the best programming language to start learning.

python is human readable so it downt take as long to learn as other languages. you can basically write anything in python you can in any language even c or c++ . the draw back is python dosn’t run as fast as the other languages because it is interpited. so programs can be written faster in python but programs will run faster in a compiled language. some use python for prototyping, they write a program that is going to require alot of rewrites because they are unsure in python first, then once it works the way they want it to the rewrite it in a complied language to get the speed. but they get to skip all the extra compile and build times if they had used compiled to start with.

Actually Python might not be the best language to actually LEARN coding, but it certainly is among the best to START getting into coding with.
It teaches you in general how to think algorithmically and how to use fundamental programming concepts such as loops and branches. However, exactly because it is a very high-level language, it is easy to code in, but it “hides” the underlying concepts of programming and some of the difficulties that arise when you step into the depths of “lower level” languages (well, I don’t think you’ll write machine code, but still…).
So, switching from C to Python is like the best thing ever but the other way round does hurt a bit - you have to take care of a lot of things, that were no problem before.

What I’m trying to say is: Python is great for a 3D artist and if you want to do it seriously, at least a bit of Python won’t hurt (especially considering the new features 2.5 will have to offer). If you’re going deeper into coding, it’s still a great thing to start with, but certainly not all you’ll ever have to know.
Just a little reminder :wink: (from my own experience as a “learner of coding”).

So where would you all’s experience tell say, a carpenter like me where to start?
I’ve been reading and reading and reading. It kinda sinks in but then I get side tracked.
I really need a crash course though.
I’d love to be able to write even a few simple scripts. And with any luck be able to contribute.
Seems to be a long way off though.


open your folder where you installed python to (should be C:Python and a number like 25 ). there is a “doc” folder. it has a decent tutorial in it that comes with pythin. if you are useing python 2.5 get mark lutz learning python 3rd edition. there is a free online book named a byte of python . the python beginners guild has alot of great links . thats one of the good things about python, alot of people use it so there are plenty of tutorials and books.

Hey rdo3,
Thanks for the reply. Yea I been in py2.5 tutorial several times. And been reading some of byte of python. And some others.
It can be frustrating reading for hours, and not understanding it fully.
And when I look at some scripts others put together, it’s quite complex. And doesn’t appear to pertain to anything I’ve read.
I probably just need to crack down and keep reading.

Great tracking article.
I’ve found myself in the same boat not long ago. But I’ve taken a more severe route.
I went to a psychiatrist and asked for medication to help improve memory as I studdied
html and what ever varible of such I found at that time. Believe it or not, it did help me stay focused.
Sometimes I may spread myself too thin in areas, and have come to realize it’s time to focus on python.


Perhaps you should try things out. Python has an interactive shell, after all, so you can experiment quite easily with it. Learning a programming language just by reading is not only dull, but also ineffective, IMO.

Do not start immediately by writing a Blender script; instead write a script that prints “99 bottles of beer on the wall”

When you get to Blender, remember that it has support for writing Python scripts including immediate execution. So you can quickly try things out.

And finally: Not all of Blender’s scripts have been written by Python experts, so it is very well possible that some of them are, from a Python programmer’s standpoint, horrible: They do their work, but they are difficult to comprehend, to modify and to extend. IMO you should learn Python as a language and then look at Blender scripts for guidance but ditch the unpythonesque or just generally bad practices you find.

@a2zhandi: I’m a house builder by profession, glad to see another who’s good at something in the real world is interested in the artificial 3d world. There’s far too much bull$h*t in a lot of people who practice trades.

A guy who I knew took me through Qbasic, Blitz Basic and the beginnings of in the course of a couple of months so I had a little background when I came to Python, but I have to say that writing code in general can be very counter-intuitve. I found that by far the best way to learn was by actually writing code. The simplest bit of functional code that you write yourself can give far more lasting knowledge than a large amout of reading.

I think that Python is a very powerful language that can be taken on many levels of complexity from the most basic linear (spaghetti) code through functional programming to fully object oriented implementations. There are a couple of ways to write scripts in Blender Python. You can write scripts to implement within the main Blender program or you can write scripts for the game engine. I’ve found the game engine useful for architectural visualisations, but it’s also good for a bit of fun. :slight_smile:

The APIs are the most useful reading you could do. Trying out the examples for the different functions and getting a grasp of how they work can give insights into coding in general as well as to the specific functions.

Blender Python API

Blender Game Engine API

Using the print statements to make your scripts give feedback to the shell window is a great way of getting fast feedback on what your changes have actually done as opposed to what you intended them to do. :wink:

Hope you have fun learning. :slight_smile:

Edit: Oh yeah… I’m far from a Python expert, but I’m improving, Don’t expect your first scripts to be either readable or efficient. Start by getting a few simple things working then when you have more knowledge, make them work better. :wink:

Thanks for the links & advice!