No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search


To have a better experience, please upgrade your IE browser.


Configuration Guide - Device Management

CloudEngine 12800 and 12800E V200R003C00

This document describes the configurations of Device Management, including device status query, hardware management, Information Center Configuration, NTP, Synchronous Ethernet Configuration, Fault Management Configuration, Energy-Saving Management Configuration, Performance Management Configuration, Maintenance Assistant Configuration, and OPS Configuration.

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Manually Running a Python Script

Manually Running a Python Script


If you do not need to bind a Python script to a trigger condition to run this script or you need to test whether a Python script runs normally, manually trigger the execution of this script using a command.


A maximum of 10 scripts can be executed manually at the same time.


  1. Upload a Python script to the device. For details on how to upload a file to the device, see File Management in the CloudEngine 12800 and 12800E Series Switches Configuration Guide - Basic Configuration.
  2. Run the ops install file file [ destination directory ] command in the user view to install the Python script.

    If you do not specify destination directory in the command, the Python script is loaded to the default path flash:/$_user/. If this parameter is specified, the Python script is loaded to the path flash:/$_user/directory/. If the specified directory does not exist, the system automatically creates the directory. A maximum of seven levels of subdirectories can be created under flash:/$_user/.

  3. Run the ops run python [ background ] file-name [ arguments ] command to run the Python script.

    If you do not specify background in the command, the Python script is executed on the foreground. If you specify background, the Python script is executed on the background.

    You can manually run a script on the foreground or background:
    • Foreground: If the script runs on the foreground, you can see information generated during script execution and enter information in interactive mode. The information you enter is transparently transmitted to the script, and the OPS does not check whether the interaction times out.

      You can stop the script by pressing Ctrl+C. If the script is configured to ignore the Ctrl+C operation, it continues running.

    • Background: All information generated during script execution is shielded, and all information you enter is sent to the script as null strings.


    If you close the current window while the Python script is running on the foreground, the script stops running.

Updated: 2019-05-05

Document ID: EDOC1100004193

Views: 71508

Downloads: 26

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Previous Next