Things between Star Wars and Python, python

Source: Internet
Author: User

Things between Star Wars and Python, python

Python and industry magic behind Star Wars

When talking about the Python language, many people will think of system O & M and Web development. Few people will know that Python can also be used for the production of movie visual effects, including the production of some movie special effects in Star Wars.

In 1975, George Lucas, the father of Star Wars, created the Industrial Magic Light and Magic. Since the first star wars, he participated in the special effects of movies. According to the official Python website, the industrial magic started to use the Python language since 1996, replacing the previous Unix shell script. The reason for this decision is that Python is difficult to learn and developed quickly. At that time, Python was only version 1.4.

The film special effects industry is highly competitive, and production companies are constantly looking for better programming languages to improve productivity. The use of the Python language has been evaluated by the Industrial magic, but there has not been a better alternative in the past 20 years.

Tommy Burnette, Senior Technical Director of Industrial magic, once said:

  • Python plays a vital role in our production process. Without it, it would be difficult to complete a big project like the second part of Star Wars. From collective rendering to batch processing to film synthesis, Python closely binds all the steps together.

It can be seen that Python is powerful.

Star Wars API

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

According to developers, the Star Wars API is the world's first quantum Star Wars dataset for programming. After a long collection and sorting process, developers summarized detailed data about the characters, race, planet, and spacecraft in the Star Wars series. Currently, this API has included new data in force awakening. The API author also developed a helper library using Python.

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

Sort all planets by size:

import swapifor planet in swapi.get_all("planets").order_by("diameter"):  print(planet.name)

Check who has driven more than one ship:

import swapifor people in swapi.get_all("people").iter():  if len(people.starships) > 1:    print(people.name)

Check whether Jar Binks appears in a movie:

import swapipm = swapi.get_film(4)jj = swapi.get_person(36)for c in pm.get_characters().iter():  if c.name == jj.name:    print("Why George, why.")

Star Wars Games Written in Python

Finally, I would like to share with you a Star Wars game developed by foreign developers using Python.

This game is similar to the current parkour, which is controlled by the up and down arrow keys.

Is it cool! Awesome! Looking forward!

Articles you may be interested in:
  • Python Regular Expression matching captures Douban Movie Links and comments code sharing
  • Python get Douban Movie Introduction code sharing
  • Python removes extra characters from the file names of movies and TV series.
  • Python: how to obtain information about a movie from a movie website based on user input

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.