01-Fundamentals Command Reference

HomeSupportSwitchesS6300 SeriesReference GuidesCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10001-Fundamentals Command Reference
12-Python commands
Title Size Download
12-Python commands 61.46 KB

Python commands

python

Use python to enter the Python shell.

Syntax

python

Views

User view

Predefined user roles

network-admin

Usage guidelines

In the Python shell, you can use the following items:

·     Python 2.7 commands.

·     Python 2.7 standard API.

·     Comware 7 extended API.

To return to user view from the Python shell, enter exit().

Examples

# Enter the Python shell.

<Sysname> python

Python 2.7.3 (default, Dec 22 2012, 11:39:05)

[GCC 4.4.1] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

>>> exit()

<Sysname>

python filename

Use python filename to execute a Python script.

Syntax

python filename [ param ]

Views

User view

Predefined user roles

network-admin

Parameters

filename: Specifies the name of a Python script on a storage medium (flash memory or USB) of the device. The script name is case sensitive and must use the extension .py. The extension .py is case insensitive.

param: Specifies the parameters to be passed to the script. To enter multiple parameters, use spaces as the delimiter.

Usage guidelines

You cannot perform any operation while a Python script is being executed by your command.

Make sure the statements in the script meet the syntax requirements. The system stops executing a Python script if it finds a statement with syntax errors.

When executing a script, the system uses the defaults for interactive statements. The system does not stop for human input.

Examples

# Execute Python script test.py.

<Sysname> python test.py 1 2

['/flash:/test.py', '1', '2']

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网