mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
22 lines
621 B
C
22 lines
621 B
C
/* this demo shows the usage of method */
|
|
#include <stdio.h>
|
|
#include "PikaMain.h"
|
|
#include "PikaVM.h"
|
|
#include "pikaScript.h"
|
|
|
|
int main(int argc, char* argv[]) {
|
|
if (1 == argc) {
|
|
pikaScriptShell(pikaScriptInit());
|
|
return 0;
|
|
}
|
|
if (2 == argc) {
|
|
PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain);
|
|
__platform_printf("======[pikascript packages installed]======\r\n");
|
|
pks_printVersion();
|
|
__platform_printf("===========================================\r\n");
|
|
pikaVM_runFile(pikaMain, argv[1]);
|
|
obj_deinit(pikaMain);
|
|
return 0;
|
|
}
|
|
}
|