This is the 8th day of my participation in Gwen Challenge

I met you, I remember you, this city was made for love, you were made for my soul. “– Margaret Duras, Love in Hiroshima

Today we’ll continue with the boa constrictor story and let’s write a simple game in Python.

What are the features of Python positioning

One of Python’s design goals is to make code highly readable.

Python’s design philosophy is “elegant,” “clear,” and “simple.”

While Python may be roughly classified as a “scripting language,” it is actually widely used by Google for large-scale software development projects such as Zope, Mnet, and BitTorrent. Python supporters prefer to call it a high-level dynamic programming language because “scripting languages” generally refer to languages that do only simple programming tasks, such as ShellScript and VBScript, and are not comparable to Python.

Python itself is designed to be extensible. Not all features and functions are integrated into the language core. Python provides a rich API and tools that make it easy for programmers to write extension modules using C, C++, and Cython. The Python compiler itself can also be integrated into other programs that require scripting languages.

The scope of Python

Now that we’ve learned Python, people might ask why we’re learning this language. In terms of the current employment situation, learning a language will undoubtedly improve your employment competitiveness, of course, learning a language is to learn essence, not just know one, do not know the other.

Here’s a look at some of the applications that Wikipedia describes:

1. Web applications

Python is often used for Web development. For example, Apache can run Web programming written in Python through the mod_WSgi module. Gunicorn, written in Python, serves as a Web server and can also run Web programs written in Python. Python defines the WSGI standard application interface to mediate the communication between Http servers and Python-based Web programming. Web frameworks such as Django, Pyramid, TurboGears, Tornado, Web2Py, Zope, Flask, and others make it easy for programmers to develop and manage complex Web programming.

Python is well supported for various network protocols, so it is often used to write server software and web crawlers. The third-party library Twisted supports asynchronous online programming and most standard network protocols (both client and server), and provides a variety of tools that are widely used to write high-performance server software. Gevent, a popular third-party library, also supports high performance and concurrent web development.

2. GUI development

Python itself includes the Tkinter library to support simple GUI development. But more Python programmers are turning to GUI packages such as wxPython or PyQt to develop cross-platform desktop software. Desktop software developed with them runs fast and is compatible with the user’s desktop environment. PyInstaller can also be used to distribute programs as separate installation packages.

3. Operating system (which is pretty awesome)

Python is a standard system component on many operating systems. Most Linux distributions and Mac OS X have Python integrated, allowing you to run Python directly from a terminal. Several Linux distributions have installers written in Python, such as Ubuntu’s Ubiquity installer, Red Hat Linux, and Fedora’s Anaconda installer. In the RPM family of Linux distributions, some of the system components are written in Python. Gentoo Linux uses Python to write its Portage package management system. The Python standard library contains several libraries that call operating system functions. Python provides access to Windows COM services and other Windows apis through pyWin32, a third-party package. With IronPython, Python programming can be called directly. The.net Framework.

4. Scientific calculation

NumPy, SciPy, Matplotlib allow Python programmers to write scientific computational programming. Some companies use Scons instead of make to build C++ programs. Many games use C++ to write high-performance modules such as graphical displays, while Python or Lua is used to write the game’s logic and servers. Lua is simpler and smaller than Python; Python supports many more features and data types. Many games, such as EVE Online, use Python to handle the extensive logic in their games.

Simple games

I wrote a little game called Rock paper Scissors.

Here’s a quick guide to installing a new development environment. It’s called Anaconda, and you can go to the official website and download it, and you can just follow it step by step. It’s not that difficult. If you have any questions, you can talk privately backstage.

Once you’ve installed it, go to the start and find Anaconda and open it up, and you’ll find something called Spyder, which basically works with Python. The following is a brief introduction of the Spyder.

Spyder is a powerful science environment written in Python for Python, designed by and for scientists, engineers and data analysts. It combines the advanced editing, analysis, debugging, and profiling capabilities of integrated development tools with the data exploration, interactive execution, in-depth inspection, and elegant visualization capabilities of scientific software packages.

Source code is as follows:

Print (" "" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - | I the first Python game: Rock, scissors, cloth | 0 represents scissors | 1 | 2 stone on behalf of the cloth "" ") -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- computer select =" 0 "# here can change the oh you choose = input (" enter your choice: ") if your choice =="0": print(" we are even ") elif your choice =="1": print(" sorry, you lost ") elif your choice =="2": print(" ha ha, so cool, you win ") else: Print (" You typed it wrong ")Copy the code

Run as follows:

This is just simple game writing, how about it? Python is fun, too. Want to learn can together oh, I am nuggets you oh ~