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
import PikaStdLib
MemChecker provides PikaScript’s memory monitoring capabilities. Can be used to view memory usage and check for memory leaks.
def max(self):
Print the current memory usage value.
Returns the largest memory footprint
def getNow(self)->float
Returns the current memory usage value.
def resetMax(self)
Reset the maximum memory usage value Example:
# main.py
mem = PikaStdLib.MemChecker()
print('mem used max:')
mem.max()
mem.resetMax()
print('mem used max:' + str(mem.getMax()))
print variable type
def remove(argPath: str):
To remove a variable/object, use a string when removing, e.g. remove('a')
.
def int(arg: any) -> int:
def float(arg: any) -> float:
def str(arg: any) -> str:
for type conversion
Inherited from BaseObj, provides print output. Formatted output is not currently supported.