PikaStdLib standard library
PikaStdLib is a built-in library
import
Add in main.py
#main.py
import PikaStdLib
class MemChecker()
MemChecker provides PikaPython’s memory monitoring capabilities. Can be used to view memory usage and check for memory leaks.
def max(self):
Print the maximum memory footprint value.
def now(self):
Print the current memory usage value.
def getMax(self)->float:
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
import PikaStdLib
mem = PikaStdLib.MemChecker()
print('mem used max:')
mem.max()
print('mem used now:')
mem.resetMax()
print('mem used max:' + str(mem.getMax()))
print('mem used now:' + str(mem.getNow()))
class SysObj()
SysObj is used to provide built-in functions, the scripts executed in main.py are executed by the root object, and the root object is created by the SysObj class, so the methods in the SysObj class are built-in functions.
def type(arg: any):
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
def print(arg:any):
Inherited from BaseObj, provides print output. Formatted output is not currently supported.