Configuring a Sample Project

The huaweicloud-sdk-dis-python-X.X.X.zip package downloaded from SDK Download provides a sample project. You can use a development tool (such as PyCharm) to compile and run the sample project on a local device. You can also develop applications based on the sample project. The code path of the sample project is as follows: [$path]\huaweicloud-sdk-dis-python-X.X.X\dis_sdk_python\examples

Procedure

  1. Obtain the huaweicloud-sdk-dis-python-X.X.X.zip package (you do not need to decompress it), launch the Command Prompt program in the directory of the current package, and enter pip install huaweicloud-sdk-dis-python-X.X.X.zip.
  2. Import the PyCharm project.

    1. Choose File > Open. The Open File or Project window is displayed.
    2. Select dis_sdk_python from the \Lib\site-packages Python installation directory. (If dis_sdk_python cannot be found after the installation, upgrade the pip and reinstall the package.)
    3. Click OK.

  3. Configure the sdk_python project.

    1. In the navigation tree on the left, choose File > Settings > Editor > Font and set the font background color.
    2. In the navigation tree on the left, choose File > Settings > Project Interpreter and add Python.
    1. Select a proper project interpreter and click OK.
    Figure 1 Adding Python
    1. In the navigation tree on the left, choose File > Settings > Editor > File Encodings and set the PyCharm code.

      Set Global Encoding, Project Encoding, and Default encoding for properties files to UTF-8.