Game implementation method and device of Python compiler, equipment and storage medium

By introducing the game library interface and target core components into the Python compiler, the problem of the Python compiler running on multiple platforms and the problem that the Skulpt interpreter cannot use external libraries is solved, and the game creation function of the Python compiler is implemented.

CN119455399APending Publication Date: 2025-02-18BEIJING SIMING QICHUANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411501361.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing Python native compilers lack cross-platform capabilities and cannot run on IOS and Android systems. Although the Skulpt interpreter can run on various platforms, it cannot be completed because it cannot directly use external libraries in the native Python ecosystem. Game production.

Method used

Obtain the current running data of the target game through the game library interface, and use the target core components to run the target game based on this data. The game library interface is created based on the game configuration file of the target game library and the code running environment of the target Python compiler. The target core component is initialized based on the game configuration data obtained from the target game library.

Benefits of technology

The game creation function of the Python compiler is implemented, allowing the Python compiler to run on multiple platforms and support game production, solving the cross-platform problem of native compilers and the problem that the Skulpt interpreter cannot use external libraries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119455399A_ABST
    Figure CN119455399A_ABST
Patent Text Reader

Abstract

The invention discloses a game implementation method and device of a Python compiler, equipment and a storage medium, and belongs to the technical field of Python software. The method comprises the steps of obtaining current operation data of a target game based on a game library interface; the game library interface is created according to a game configuration file of the target game library and a code running environment of the target Python compiler; running the target game according to the current running data based on the target core component; the target core component is obtained through initialization according to game configuration data obtained from the target game library. According to the technical scheme, the game library and the target Python compiler are combined for use, and the game creation function of the Python compiler is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of Python software technology, in particular to the field of Python game creation technology, and specifically to a game implementation method, device, equipment and storage medium of a Python compiler. Background Art

[0002] Python's native compiler does not have cross-platform capabilities and cannot run on IOS (iPhone Operating System) or Android (Android Operating System). If you want to run it, you can only use the Web (World Wide Web) version of Python interpreter. In the open source community, there is a Python interpreter called Skulpt, which can convert JS code for execution. Because Web capabilities can run on all platforms, Skulpt can naturally run on various platforms and interpret and execute Python code.

[0003] Unlike the native interpreter, although the Skulpt interpreter covers most of the syntax in Python, the external libraries in the native Python ecosystem cannot be used directly, resulting in the lack of Pgzrun implementation based on the Skulpt interpreter engine, making it impossible to complete game production. Summary of the invention

[0004] The present application provides a game implementation method, apparatus, device and storage medium of a Python compiler to implement the game creation function of the Python compiler.

[0005] According to one aspect of the present application, a game implementation method of a Python compiler is provided, the method comprising:

[0006] Based on the game library interface, the current running data of the target game is obtained; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler;

[0007] Based on the target core component, the target game is run according to the current running data; the target core component is initialized according to the game configuration data obtained from the target game library.

[0008] According to another aspect of the present application, a game implementation device of a Python compiler is provided, the device comprising:

[0009] A data acquisition module, used to acquire the current running data of the target game based on the game library interface; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler;

[0010] The game running module is used to run the target game based on the target core component and the current running data; the target core component is initialized based on the game library interface.

[0011] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:

[0012] one or more processors;

[0013] A memory for storing one or more programs;

[0014] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the Python compiler game implementation methods provided in the embodiments of the present application.

[0015] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the game implementation method of any Python compiler provided in the embodiments of the present application is implemented.

[0016] This application obtains the current running data of the target game based on the game library interface; the game library interface is created based on the game configuration file of the target game library and the code running environment of the target Python compiler; based on the target core component, the target game is run according to the current running data; the target core component is initialized according to the game configuration data obtained from the target game library. The above technical solution realizes the game creation function of the Python compiler by combining the game library with the target Python compiler. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flowchart of a game implementation method of a Python compiler provided according to Embodiment 1 of the present application;

[0018] Figure 2 This is a flowchart of a game implementation method of a Python compiler provided according to Embodiment 2 of the present application;

[0019] Figure 3 It is a structural diagram of a game implementation device of a Python compiler provided according to the third embodiment of the present application;

[0020] Figure 4It is a structural diagram of an electronic device that implements the game implementation method of the Python compiler of the embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] In addition, it should be noted that the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as current operating data and game configuration files involved in the technical solution of this application are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0024] Embodiment 1

[0025] Figure 1 This is a flowchart of a Python compiler game implementation method provided in the first embodiment of the present application. This embodiment is applicable to the case of creating games based on the Skulpt interpreter, and can be executed by a Python compiler game implementation device. The Python compiler game implementation device can be implemented in the form of hardware and / or software. The Python compiler game implementation device can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:

[0026] S110. Based on the game library interface, obtain the current running data of the target game; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler.

[0027] Among them, the game library interface is a programming interface that allows developers to interact with the game library. The target game refers to the game that needs to be developed and run at present; specifically, the game library interface is a bridge between the Skulpt interpreter and the Pgzrun library. The target game refers to a specific game instance that monitors and obtains real-time data through the game library interface; the target game in the embodiment of the present application specifically refers to a web game. The current running data refers to various real-time information and status data of the target game at the current moment, which may include at least one of the game's progress status, the player's current status, the status of the game scene, and the game progress. The target game library refers to the code library or resource library of the game, which contains various functions and data required for the game to run, and provides the necessary support for the game to run, such as graphics rendering, physics engine, sound effect processing, etc. Developers can interact with this library through the interface to obtain or modify game data; in the embodiment of the present application, the target game library specifically refers to the Pgzrun library. The game configuration file refers to a file used to define and configure game parameters, which usually contains information about game settings, resource paths, game rules, etc. These configuration files help the game engine or game library to correctly load and initialize game content at runtime. The target Python compiler is a Python interpreter written in JavaScript that allows Python code to be run in a browser; in the embodiment of the present application, the target Python compiler specifically refers to the Skulpt compiler. The code runtime environment refers to the runtime environment required to execute JavaScript code, which provides the infrastructure required to execute Python code, such as memory management, exception handling, code interpretation, etc.; when interacting with the game library interface, the runtime environment must be correctly configured to ensure that the code can be executed correctly.

[0028] Exemplarily, the game library interface can be implemented in the following manner: create a JavaScript file based on the game configuration file of the target game library; define a file import method in the JavaScript file; based on the file import method, build the game library interface in the target Python compiler according to the JavaScript file.

[0029] It should be noted that this game library interface can be used as a built-in module of Skulpt; this module can be called in Python code to access and manipulate game data or functions, just like using other built-in modules.

[0030] Specifically, create a JavaScript file that will contain defined and exported functions or data; in this JS file, define a method that adds your file content as a module to Skulpt's built-in module collection; through this method, add the content of the JS file to the object used by Skulpt to manage and access built-in files. In this way, Skulpt can use this custom JavaScript module to provide specific functions or data when running Python code.

[0031] S120. Running a target game based on a target core component and current running data; the target core component is initialized based on game configuration data obtained from a target game library.

[0032] The target core component refers to the core engine or module for the target game to run, which may include image rendering engine, game logic and event processing engine, resource management engine, screen management engine, etc. Game configuration data refers to the parameters and information used to set and adjust game behavior and performance. These data usually include game rules, level settings, character attributes, image resource paths, sound settings, etc. They define the basic structure and operation logic of the game to ensure that the game runs as expected.

[0033] In an optional implementation, the initialization process of the target core component is as follows: parsing the game configuration data obtained from the target game library to obtain target configuration data, and determining the component type of at least one target core component in the target Python compiler; initializing the target core component according to the target configuration data and the component type.

[0034] The target configuration data refers to the parsed specific game setting data, which is used to initialize the core components of the game. The component category refers to the specific function or category of the core component, such as the rendering engine, physics engine, etc.

[0035] Further, according to the target configuration data and the component type, initializing the target core component can be, according to the component type, determining the component configuration data corresponding to the component type from the target configuration data; and initializing the target core component corresponding to the component type in the target Python compiler according to the component configuration data.

[0036] Component configuration data refers to configuration details related to a specific component type; these data define how to set up and run the core components of that type.

[0037] The embodiment of the present application obtains the current running data of the target game based on the game library interface; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler; based on the target core component, the target game is run according to the current running data; the target core component is initialized according to the game configuration data obtained from the target game library. The above technical solution realizes the game creation function of the Python compiler by combining the game library with the target Python compiler.

[0038] Embodiment 2

[0039] Figure 2 This is a flowchart of a game implementation method of a Python compiler provided in Example 2 of this application. Based on the technical solutions of the above embodiments, this embodiment adds "based on the game library interface and rendering interface, monitor the real-time rendering data of the target game; based on the image rendering component, display the real-time status of the target game according to the real-time rendering data". It should be noted that for the parts not described in detail in the embodiments of this application, please refer to the relevant descriptions of other embodiments. Figure 2 As shown, the method includes:

[0040] S210. Based on the game library interface, obtain the current running data of the target game; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler.

[0041] S220. Running the target game based on the target core component and the current running data; the target core component is initialized based on the game configuration data obtained from the target game library.

[0042] For example, the core components are AppRenderer (Application Renderer), ResourceManager and IO (Keyboard Input / Output). When the AppRenderer component is initialized, the internal inherent state and internal properties are added for the degradation strategy when it is not compatible with webgl (Web Graphics Library); when the ResourceManager component is initialized, it accepts a structure tree object, which represents a resource object after decompression of a compression library. The data of the corresponding resource can be directly obtained through the inheritance method of the compression library file, which is mainly used for multi-image loading and relative path reference; a hook is added to the resource loader through the resource loading method, and the resource name is referenced in the hook function to access the subdirectory in the compressed file of the current structure tree; when the IO component is initialized, the window is used to add an event listener to listen to the key event; among them, the key event is continuously triggered by long pressing in the web platform, so in order to avoid performance problems caused by excessive frequent triggering, before initializing this module to bind the global IO event, an anti-shake effect is added to the key event processor, and the shortest trigger interval of the function call event is 150 milliseconds.

[0043] Optionally, the target core component includes an image rendering component. Accordingly, the image rendering component can be initialized in the following manner: creating a rendering interface for the target Python compiler according to the rendering configuration file of the target rendering engine and the code running environment of the target Python compiler; based on the rendering interface and the game library interface, initializing the graphics rendering component of the target Python compiler according to the game configuration data obtained from the target game library.

[0044] Among them, the target rendering engine refers to a JavaScript library used for rendering; in this embodiment, the target rendering engine specifically refers to PIXI.js (PIXI Graphics Engine, PIXI rendering engine). The image rendering component refers to a software module or library responsible for rendering graphic data (such as pictures, animations, etc.) to the screen. In game development and graphics applications, the image rendering component usually involves graphics processing and display technology, such as 2D or 3D rendering. The rendering configuration file refers to the settings and parameters related to the rendering engine. These settings determine how to process and render images, including resolution, image quality, rendering mode, etc. It is usually a configuration file (such as JSON, XML format) loaded at initialization to adjust the behavior of the rendering engine. The rendering interface refers to a software interface or API (Application Programming Interface) for interacting with the rendering engine. It provides a set of methods and functions so that the program can control and customize the rendering process; for example, it can provide functions such as drawing images and setting rendering parameters.

[0045] S230: Based on the game library interface and the rendering interface, monitor the real-time rendering data of the target game.

[0046] Among them, real-time rendering data refers to the image and graphics data generated by the game when it is running. It includes information such as game screen, frame rate, graphics details, etc., which is used to monitor and analyze the visual output of the game.

[0047] S240: Based on the image rendering component, display the real-time status of the target game according to the real-time rendering data.

[0048] Among them, real-time status refers to the current status or data of the system or application at a specific point in time; in games, it includes information such as game screen, character position, environmental changes, etc., which reflects the real-time performance of the game during operation; real-time status monitoring and display allows users or developers to instantly understand and respond to dynamic changes in the system.

[0049] Optionally, during the rendering loop of the image rendering component, the callback function in the target game library is called for each frame.

[0050] It should be noted that the calling method for calling the callback function in the target game library is the asynchronous calling method of Skulpt.

[0051] There is a derivative problem here. If the callback function is called directly, the JS (JavaScript) and Python environments will be out of order. To solve this problem, a suspend handler is added, which means that when using the asynchronous call method in Skulpt, the Python rendering cycle callback function is called in order, and the next one is executed after the previous one is executed.

[0052] In this embodiment, the suspension processor is an object, which is passed as the first parameter to the asynchronous call method. This object contains the Skulp object, the attribute value is a function, and the parameter of this function is a suspension object, which represents the controller in the current execution flow. When this function is called, it means that the call of the next frame has begun, so the application timer stop method in PIXI.js is used here to stop rendering until the current method has been executed. The method of continuing execution is to inject a recovery function into the suspension object. When the recovery function is called, it means that the current method has been executed. Then the application timer start method in PIXI.js is used here to start rendering.

[0053] The embodiment of the present application obtains the current running data of the target game based on the game library interface; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler; based on the target core component, the target game is run according to the current running data; the target core component is initialized according to the game configuration data obtained from the target game library; based on the game library interface and the rendering interface, the real-time rendering data of the target game is monitored; based on the image rendering component, the real-time status of the target game is displayed according to the real-time rendering data. The above technical solution realizes the game creation function of the Python compiler by combining the game library with the target Python compiler.

[0054] Embodiment 3

[0055] Figure 3 This is a schematic diagram of a Python compiler game implementation device according to the third embodiment of the present application, which can be applied to the case of creating games based on the Skulpt interpreter. The Python compiler game implementation device can be implemented in the form of hardware and / or software. The Python compiler game implementation device can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:

[0056] The data acquisition module 310 is used to acquire the current running data of the target game based on the game library interface; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler;

[0057] The game running module 320 is used to run the target game based on the target core component and the current running data; the target core component is initialized based on the game library interface.

[0058] The embodiment of the present application obtains the current running data of the target game based on the game library interface; the game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler; based on the target core component, the target game is run according to the current running data; the target core component is initialized according to the game configuration data obtained from the target game library. The above technical solution realizes the game creation function of the Python compiler by combining the game library with the target Python compiler.

[0059] Optionally, the device further includes a component initialization module, which is used to:

[0060] Parsing the game configuration data obtained from the target game library to obtain target configuration data, and determining the component type of at least one target core component in the target Python compiler;

[0061] Initializes the target core components according to the target configuration data and component type.

[0062] Optional, component initialization module, specifically used for:

[0063] According to the component type, determining component configuration data corresponding to the component type from the target configuration data;

[0064] Initialize the target core component corresponding to the component type in the target Python compiler according to the component configuration data.

[0065] Optionally, the target core component includes an image rendering component; accordingly, the component initialization module is further used to:

[0066] Create a rendering interface for the target Python compiler based on the rendering configuration file of the target rendering engine and the code running environment of the target Python compiler;

[0067] Based on the rendering interface and the game library interface, the graphics rendering component of the target Python compiler is initialized according to the game configuration data obtained from the target game library.

[0068] Optionally, the device further includes a game rendering module, which is used to:

[0069] Based on the game library interface and rendering interface, monitor the real-time rendering data of the target game;

[0070] Based on the image rendering component, the real-time status of the target game is displayed according to the real-time rendering data.

[0071] The game implementation device of the Python compiler provided in the embodiment of the present application can execute the game implementation method of the Python compiler provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the game implementation method of each Python compiler.

[0072] Embodiment 4

[0073] Figure 4 It is a structural diagram of an electronic device 410 that implements the game implementation method of the Python compiler of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples, and are not intended to limit the implementation of the present application described herein and / or required.

[0074] like Figure 4 As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0075] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0076] Processor 411 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. Processor 411 executes the various methods and processes described above, such as the game implementation method of the Python compiler.

[0077] In some embodiments, the game implementation method of the Python compiler can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via ROM412 and / or communication unit 419. When the computer program is loaded into RAM413 and executed by processor 411, one or more steps of the game implementation method of the Python compiler described above can be performed. Alternatively, in other embodiments, processor 411 can be configured as a game implementation method of the Python compiler by any other appropriate means (e.g., by means of firmware).

[0078] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0079] The computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other game implementation device of a programmable Python compiler, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0080] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0081] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0082] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0083] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0084] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.

[0085] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A game implementation method of a Python compiler, characterized in that: include: Based on the game library interface, obtain the current running data of the target game; The game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler; Based on the target core component, and according to the current running data, running the target game; The target core component is initialized according to the game configuration data obtained from the target game library.

2. The method according to claim 1, characterized in that The initialization process of the target core component is as follows: Parsing the game configuration data obtained from the target game library to obtain target configuration data, and determining a component type of at least one target core component in the target Python compiler; Initialize the target core component according to the target configuration data and the component type.

3. The method according to claim 2, characterized in that Initializing the target core component according to the target configuration data and the component type includes: According to the component type, determining component configuration data corresponding to the component type from the target configuration data; According to the component configuration data, a target core component corresponding to the component type in the target Python compiler is initialized.

4. The method according to claim 1, characterized in that: The target core component includes an image rendering component; accordingly, the initialization process of the image rendering component is as follows: Creating a rendering interface for the target Python compiler according to a rendering configuration file of the target rendering engine and a code running environment of the target Python compiler; Based on the rendering interface and the game library interface, and according to the game configuration data obtained from the target game library, the graphics rendering component of the target Python compiler is initialized.

5. The method according to claim 4, characterized in that The method further comprises: Based on the game library interface and the rendering interface, monitoring the real-time rendering data of the target game; Based on the image rendering component, the real-time status of the target game is displayed according to the real-time rendering data.

6. A game implementation device of a Python compiler, characterized in that: include: The data acquisition module is used to obtain the current running data of the target game based on the game library interface; The game library interface is created according to the game configuration file of the target game library and the code running environment of the target Python compiler; A game running module, used to run the target game based on the target core component and the current running data; The target core component is initialized based on the game library interface.

7. The device according to claim 6, characterized in that The device also includes: The component initialization module is used to parse the game configuration data obtained from the target game library, obtain the target configuration data, and determine the component type of at least one target core component in the target Python compiler; initialize the target core component according to the target configuration data and component type.

8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the game implementation method of the Python compiler as described in any one of claims 1-5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the game implementation method of the Python compiler as described in any one of claims 1 to 5 is implemented.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the game implementation method of the Python compiler according to any one of claims 1 to 5.