5.1. PikaStdLib standard library

    Add the dependency of PikaStdLib to requestment.txt. The version number of PikaStdLib should be the same as the version number of the kernel.

    Run pikaPackage.exe

    Add in main.py

    1. import PikaStdLib

    MemChecker provides PikaScript’s memory monitoring capabilities. Can be used to view memory usage and check for memory leaks.

    1. def max(self):

      Print the current memory usage value.

      Returns the largest memory footprint

      1. def getNow(self)->float

      Returns the current memory usage value.

      1. def resetMax(self)

      Reset the maximum memory usage value Example:

      1. # main.py
      2. mem = PikaStdLib.MemChecker()
      3. print('mem used max:')
      4. mem.max()
      5. mem.resetMax()
      6. print('mem used max:' + str(mem.getMax()))

      print variable type

      1. def remove(argPath: str):

      To remove a variable/object, use a string when removing, e.g. remove('a').

      1. def int(arg: any) -> int:
      2. def float(arg: any) -> float:
      3. def str(arg: any) -> str:

      for type conversion

        Inherited from BaseObj, provides print output. Formatted output is not currently supported.