The things between Star Wars and Python

Source: Internet
Author: User
The Industrial Light demon behind the python and Star Wars

Mentioning the Python language, many people will think of system operations, web development and other work. Few people will know that Python can also be used to make movie visual effects, including the creation of some of the movie effects of Star Wars.

The father of Star Wars, George Lucas, created the Industrial Light Demon in 1975 (Full name: Industrial Lights and Magic) and participated in the special effects of the film from the first Star Wars. According to the Python website, the Industrial Light demon has been replacing the previous Unix shell script with the Python language since 1996. The reason why Industrial light demons make this decision is that Python is less difficult to learn and faster to develop. At the time, Python was only version 1.4.

The film special effects industry competition is very intense, the production company will continue to look for more excellent programming language, improve work efficiency. Industrial Light Demon is also always evaluating the use of Python language, but has not found a better alternative in the last 20 years.

Tommy Burnette, senior technical director of Industrial Light demon, once said:

    • Python plays a vital role in our production process. Without it, big projects like the second Star Wars are hard to complete. From collective rendering to batch processing to movie compositing, Python tightly binds all the steps together.

This shows the power of Python.

Star Wars API

Do you know how many races and ships are there in the Star Wars series? These answers can all be found in the Star Wars API.

According to the developer, the Star Wars API is the world's first quantifiable, programmable Star Wars dataset. After a long collection and collation, the developers have compiled detailed data on the characters, races, planets, ships and so on in the Star Wars movie series. The new data in the Force Awakening is now included in this API. The author of the API also developed a helper library with Python.

Let's see what we can do with this library.

To arrange all planets by size:

Import Swapifor Planet in Swapi.get_all ("planets"). Order_by ("diameter"):  print (Planet.name)

See who has been driving more than 1 ships:

Import swapifor people in Swapi.get_all ("people"). ITER ():  If Len (people.starships) > 1:    print (People.name)

Retrieves whether the Jar Jar Binks appears in the movie:

Import SWAPIPM = Swapi.get_film (4) JJ = Swapi.get_person ($) for C in Pm.get_characters (). ITER ():  if c.name = = Jj.name:    print ("Why George, Why.")

Star Wars games written in Python

Finally, to share with you a foreign developer of the Star Wars related games developed with Python, I hope you like it.

This game is similar to the current parkour, controlled by the upper and lower left and right arrow keys.

Isn't it cool! Great location. Look forward to it!

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.