What is that needs to be coded in Python instead of C/C++ etc? I know its advantages etc. I want to know why exactly makes Python The language for p开发者_如何学JAVAeople in this industry?
I work in this industry, and here's what I've observed:
It's a nice, tidy language that's not hard to pick up. You don't have to be a language guru to use it.
It embeds nicely in C/C++ applications.
It has data types, so numeric operations can be done without type shimmering.
Speaking of numeric operations, NumPy!
Network effect -- everybody else uses it, so we get a virtuous cycle of interoperable scripting.
Perhaps that's because it's a scripting language for Blender?
A few other points I've not seen in the existing answers:
- it's free
- it's fast [enough]
- it runs on every platform I know of (AIX, HPUX, Linux, Mac OS X, Windows..)
- quick to learn
- large, powerful libraries
- numeric
- graphical
- etc
- simple, consistent syntax
- the existing user-base is large
- because it's easy-to-learn, you don't have to be a "programmer" to use it
Because Python is what Basic should have been ;)
Its a language designed from the beginning to be used by non-programmers, but with the power to be truly used as a general purpose programming language.
Aside from the fact that it's already in use, the main advantage is that it's quick to use. Java, C, and friends almost all require tedious coding that merely restates what you already know. Python is designed to be quick to write, quick to modify, and as general as possible.
As an example, functions in java require you to declare the type of each of the input variables. In python, as long as you pass input variables that work with the function, it's valid. This makes your code extremely flexible. You don't waste time declaring variables as one type or another, you just use them.
Some people will tell you that java produces code that is "more correct", but in animation and graphics, producing code that works in as short a time as possible is usually the goal.
My guess is that it is the tool for the job because it is easy to prototype extra features.
I used python for molecular animation using PyMol. Many molecular visualization programs have their own scripting languages. PyMol's scripting language is python, a real programming language. So, if your task requires calculations of any kind, text parsing or calling the net, you are welcome. Before I assume that in "conventional" animation the situation is similar.
精彩评论