From d026e84aac26cd9093a2b17c77b804755e13d136 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 15:42:15 +0800 Subject: [PATCH 01/49] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=20=E4=BF=AE=E6=AD=A3=E5=87=BD=E6=95=B0enumer?= =?UTF-8?q?ate=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 03fdf74..4d1eeef 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -1,4 +1,8 @@ -import math, sys, imp, os, threading +import imp +import math +import os +import sys +import threading from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 @@ -12,6 +16,7 @@ def 分析并编译(源码文件名): 节点 = 分析器.分析(源码=源码, 源码文件=源码文件名) return compile(节点, 源码文件名, 'exec') + def 加载木兰模块(名称, 全局, 源自=(), 目录相对层次=0): 木兰源码路径 = str(Path(*(名称.split(".")))) + '.ul' 可执行码 = 分析并编译(木兰源码路径) @@ -21,7 +26,7 @@ def 加载木兰模块(名称, 全局, 源自=(), 目录相对层次=0): # TODO: 研究何用 所有模块 = [] 后段 = 名称 - 模块名 = lambda 名称: 所有模块[-1].__name__ + '.' + 名称 if 所有模块 else "" + 模块名 = lambda 模块名称: 所有模块[-1].__name__ + '.' + 模块名称 if 所有模块 else "" 点位 = 0 while 点位 != -1: @@ -53,6 +58,7 @@ def 加载木兰模块(名称, 全局, 源自=(), 目录相对层次=0): return 顶层 + def 内置扩展(内置项): from inspect import isclass for k, v in __builtins__.items(): @@ -61,18 +67,20 @@ def 内置扩展(内置项): return 内置项 + def __内置_除(a, b): if isinstance(a, int): if isinstance(b, int): return math.floor(a / b) return a / b + def __内置_求余(a, b): # TODO: 不解为何要在 a b 为整数时特殊处理 return a % b -def 创建全局变量(argv=[], 文件名=''): +def 创建全局变量(argv=[], 文件名=''): def 转字符串(x): def 容器转为字符串(容器, 始='', 末=''): @@ -138,18 +146,18 @@ def 创建全局变量(argv=[], 文件名=''): 'print': 自定义输出, 'println': lambda *各物件: 自定义输出(*各物件, **{'终止符': '\n'}), 'assert': 本地断言, - 'enumerate':enumerate, 'len': len, + 'enumerate': enumerate, 'all': all, 'any': any, 'range': range, - 'input':input, - 'super':super, + 'input': input, + 'super': super, 'int': int, 'str': str, 'list': list, 'set': set, - 'tuple':lambda *各实参: 各实参, + 'tuple': lambda *各实参: 各实参, 'char': chr, 'bytes': lambda 文本, 编码='ascii': bytes(文本, encoding=编码), 'isa': lambda x, 类型: isinstance(x, 类型), @@ -157,13 +165,13 @@ def 创建全局变量(argv=[], 文件名=''): 'min': min, 'map': map, 'filter': filter, - 'zip':zip, + 'zip': zip, 'staticmethod': staticmethod, - 'property':property, - 'self':内置自身, - '再会':sys.exit, - 'quit':sys.exit, - 'open':open, + 'property': property, + 'self': 内置自身, + '再会': sys.exit, + 'quit': sys.exit, + 'open': open, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, @@ -173,4 +181,4 @@ def 创建全局变量(argv=[], 文件名=''): '__print__': eval_print, '__div__': __内置_除, '__rem__': __内置_求余}) - } \ No newline at end of file + } -- Gitee From 9f8da7c722024253ca2d28b1f1f2f988f488490f Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 15:50:14 +0800 Subject: [PATCH 02/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0round=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 4d1eeef..003dbe6 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -151,6 +151,7 @@ def 创建全局变量(argv=[], 文件名=''): 'all': all, 'any': any, 'range': range, + 'round': round, 'input': input, 'super': super, 'int': int, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index e8d3a37..bdf2968 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -10,4 +10,5 @@ print(isa("a", str)) print(isa("a", int)) print(max(2, 3)) print(min(2, 3)) -print(bytes("ab")) \ No newline at end of file +print(bytes("ab")) +print(round(12.555, 2)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 1b7891a..b7f7cfb 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From ec38a2d5e8a8193f78ce41151f9b1732e96a5b18 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:29:04 +0800 Subject: [PATCH 03/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0reverse=E5=8F=8D?= =?UTF-8?q?=E5=BA=8F=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../API/\345\206\205\347\275\256.ul" | 6 +++++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 003dbe6..64335cb 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -153,6 +153,7 @@ def 创建全局变量(argv=[], 文件名=''): 'range': range, 'round': round, 'input': input, + 'reverse': reversed, 'super': super, 'int': int, 'str': str, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index bdf2968..e890cb8 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -11,4 +11,8 @@ print(isa("a", int)) print(max(2, 3)) print(min(2, 3)) print(bytes("ab")) -print(round(12.555, 2)) \ No newline at end of file +print(round(12.555, 2)) +lst = reverse('abc') +for i, c in enumerate(lst) { + print(c) +} diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index b7f7cfb..2b558b3 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 5d04e5f3c2f7acad46a500ddc2e75d7c8c3f3437 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:37:08 +0800 Subject: [PATCH 04/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0locals=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 64335cb..9165a9d 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -155,6 +155,7 @@ def 创建全局变量(argv=[], 文件名=''): 'input': input, 'reverse': reversed, 'super': super, + 'locals': lambda: locals(), 'int': int, 'str': str, 'list': list, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index e890cb8..9c1e320 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -16,3 +16,4 @@ lst = reverse('abc') for i, c in enumerate(lst) { print(c) } +print(locals()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 2b558b3..c976843 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 896aadbe37d0a8a23da992dea14c52ba0caac7d7 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:39:20 +0800 Subject: [PATCH 05/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0bool=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 9165a9d..5a5ce48 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -156,6 +156,7 @@ def 创建全局变量(argv=[], 文件名=''): 'reverse': reversed, 'super': super, 'locals': lambda: locals(), + 'bool': bool, 'int': int, 'str': str, 'list': list, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 9c1e320..802c3b4 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -16,4 +16,5 @@ lst = reverse('abc') for i, c in enumerate(lst) { print(c) } -print(locals()) \ No newline at end of file +print(locals()) +print(bool(1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index c976843..cc65a99 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 8a7b2641b9799b6dbd7547d134f2a61f868c4116 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:41:32 +0800 Subject: [PATCH 06/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0float=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 5a5ce48..cc07c57 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -157,6 +157,7 @@ def 创建全局变量(argv=[], 文件名=''): 'super': super, 'locals': lambda: locals(), 'bool': bool, + 'float': float, 'int': int, 'str': str, 'list': list, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 802c3b4..9a371b9 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -18,3 +18,4 @@ for i, c in enumerate(lst) { } print(locals()) print(bool(1)) +print(float('1.1')) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index cc65a99..3d367a6 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 64c2ac5ac320cd6f4ce0cc157016b1b06bb153a3 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:50:00 +0800 Subject: [PATCH 07/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0dict=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../API/\345\206\205\347\275\256.ul" | 6 +++++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index cc07c57..00ed605 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -161,6 +161,7 @@ def 创建全局变量(argv=[], 文件名=''): 'int': int, 'str': str, 'list': list, + 'dict': dict, 'set': set, 'tuple': lambda *各实参: 各实参, 'char': chr, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 9a371b9..6c7a917 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -18,4 +18,8 @@ for i, c in enumerate(lst) { } print(locals()) print(bool(1)) -print(float('1.1')) \ No newline at end of file +print(float('1.1')) +dic = dict({'a':1}) +for k in dic { + print(k, dic[k]) +} \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 3d367a6..9f663c6 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 1", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 6db36ba4ab45282ab372d43d00f33dc2cdd3c665 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 17:53:47 +0800 Subject: [PATCH 08/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ord=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 00ed605..92c29f2 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -165,6 +165,7 @@ def 创建全局变量(argv=[], 文件名=''): 'set': set, 'tuple': lambda *各实参: 各实参, 'char': chr, + 'ord': ord, 'bytes': lambda 文本, 编码='ascii': bytes(文本, encoding=编码), 'isa': lambda x, 类型: isinstance(x, 类型), 'max': max, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 6c7a917..d60aa89 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -22,4 +22,5 @@ print(float('1.1')) dic = dict({'a':1}) for k in dic { print(k, dic[k]) -} \ No newline at end of file +} +print(ord('好')) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 9f663c6..b9f12e3 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 1", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 24897fd5cdd645fe1c1471925bece05eb4699b54 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:00:30 +0800 Subject: [PATCH 09/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0typeof=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 92c29f2..5dc014c 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -167,6 +167,7 @@ def 创建全局变量(argv=[], 文件名=''): 'char': chr, 'ord': ord, 'bytes': lambda 文本, 编码='ascii': bytes(文本, encoding=编码), + 'typeof': lambda 对象: 对象.__class__.__name__, 'isa': lambda x, 类型: isinstance(x, 类型), 'max': max, 'min': min, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index d60aa89..b1d344c 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -24,3 +24,4 @@ for k in dic { print(k, dic[k]) } print(ord('好')) +print(typeof(1)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index b9f12e3..af00c52 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From a8eef732969052a559a6b0975e007c29d76f54f6 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:04:38 +0800 Subject: [PATCH 10/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0ceil=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 5dc014c..5cc8dc3 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -176,6 +176,7 @@ def 创建全局变量(argv=[], 文件名=''): 'zip': zip, 'staticmethod': staticmethod, 'property': property, + 'ceil': math.ceil, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index b1d344c..3405cf7 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -24,4 +24,5 @@ for k in dic { print(k, dic[k]) } print(ord('好')) -print(typeof(1)) \ No newline at end of file +print(typeof(1)) +print(ceil(1.1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index af00c52..184fcfb 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int2", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From be90eb97030f1d7cce881244eab00bf97e332a9a Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:09:05 +0800 Subject: [PATCH 11/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0floor=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 5cc8dc3..3921108 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -177,6 +177,7 @@ def 创建全局变量(argv=[], 文件名=''): 'staticmethod': staticmethod, 'property': property, 'ceil': math.ceil, + 'floor': math.floor, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 3405cf7..837b3cd 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -26,3 +26,4 @@ for k in dic { print(ord('好')) print(typeof(1)) print(ceil(1.1)) +print(floor(1.1)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 184fcfb..e4c3bd5 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int2", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int21", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 193504d7656645cf4eb71c5ec39260e4f923c3b5 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:12:30 +0800 Subject: [PATCH 12/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0fabs=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 3921108..fe91f63 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -178,6 +178,7 @@ def 创建全局变量(argv=[], 文件名=''): 'property': property, 'ceil': math.ceil, 'floor': math.floor, + 'fabs': math.fabs, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 837b3cd..164db19 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -26,4 +26,5 @@ for k in dic { print(ord('好')) print(typeof(1)) print(ceil(1.1)) -print(floor(1.1)) \ No newline at end of file +print(floor(1.1)) +print(fabs(-1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index e4c3bd5..b3d89b7 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int21", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.0", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 3a0d68e354cce932ee596a8a2d4ead9fb8e5e16a Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:14:32 +0800 Subject: [PATCH 13/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sqrt=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index fe91f63..d185b0b 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -179,6 +179,7 @@ def 创建全局变量(argv=[], 文件名=''): 'ceil': math.ceil, 'floor': math.floor, 'fabs': math.fabs, + 'sqrt': math.sqrt, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 164db19..fefbc91 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -28,3 +28,4 @@ print(typeof(1)) print(ceil(1.1)) print(floor(1.1)) print(fabs(-1)) +print(sqrt(4)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index b3d89b7..f7c3045 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.0", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.0", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From e4e36acf115961bbb41395be43315816ba56fe92 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:16:30 +0800 Subject: [PATCH 14/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0log=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index d185b0b..a88f9ea 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -180,6 +180,7 @@ def 创建全局变量(argv=[], 文件名=''): 'floor': math.floor, 'fabs': math.fabs, 'sqrt': math.sqrt, + 'log': math.log, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index fefbc91..2b4525f 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -29,3 +29,4 @@ print(ceil(1.1)) print(floor(1.1)) print(fabs(-1)) print(sqrt(4)) +print(log(1)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index f7c3045..1d078aa 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.0", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.0", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From abbbccde63174a34c3415d39d11805e35ad1ada3 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:18:10 +0800 Subject: [PATCH 15/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0log10=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index a88f9ea..96471c2 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -181,6 +181,7 @@ def 创建全局变量(argv=[], 文件名=''): 'fabs': math.fabs, 'sqrt': math.sqrt, 'log': math.log, + 'log10': math.log10, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 2b4525f..b3df592 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -29,4 +29,5 @@ print(ceil(1.1)) print(floor(1.1)) print(fabs(-1)) print(sqrt(4)) -print(log(1)) \ No newline at end of file +print(log(1)) +print(log10(10)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 1d078aa..12e375d 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,7 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.0", + "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0", "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From e2cfb2d6e31836f26d97d74cd4201589603f254c Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:23:05 +0800 Subject: [PATCH 16/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0exp=E5=87=BD=E6=95=B0?= =?UTF-8?q?=20=E6=9C=9F=E6=9C=9B=E5=80=BC=E8=A1=A8=E4=B8=AD=E7=BE=8E?= =?UTF-8?q?=E5=8C=96=E8=BF=94=E5=9B=9E=E5=80=BC=E4=B8=B2=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 96471c2..46b8c29 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -182,6 +182,7 @@ def 创建全局变量(argv=[], 文件名=''): 'sqrt': math.sqrt, 'log': math.log, 'log10': math.log10, + 'exp': math.exp, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index b3df592..2070bd4 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -31,3 +31,4 @@ print(fabs(-1)) print(sqrt(4)) print(log(1)) print(log10(10)) +print(exp(1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 12e375d..af93059 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -52,7 +52,10 @@ from sys import platform "函数/map.ul": b"[1, 4, 9]", "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", - "函数/API/内置.ul": b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0", + "函数/API/内置.ul": ( + b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0" + b"2.718281828459045" # exp(1) + ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From f9f5e2c5fde7bdaa10981359d77284c99474ee7d Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:25:44 +0800 Subject: [PATCH 17/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0pow=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 3 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 46b8c29..4f936b9 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -183,6 +183,7 @@ def 创建全局变量(argv=[], 文件名=''): 'log': math.log, 'log10': math.log10, 'exp': math.exp, + 'pow': math.pow, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 2070bd4..74a55fb 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -32,3 +32,4 @@ print(sqrt(4)) print(log(1)) print(log10(10)) print(exp(1)) +print(pow(9, 3)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index af93059..8e6e202 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -55,6 +55,7 @@ from sys import platform "函数/API/内置.ul": ( b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0" b"2.718281828459045" # exp(1) + b"729.0" # pow(9, 3) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From d437d283a56e6c8c945f5a02e3ebada166fd7161 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:54:47 +0800 Subject: [PATCH 18/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sin=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 4f936b9..3999740 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -184,6 +184,7 @@ def 创建全局变量(argv=[], 文件名=''): 'log10': math.log10, 'exp': math.exp, 'pow': math.pow, + 'sin': math.sin, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 74a55fb..54f7240 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -32,4 +32,5 @@ print(sqrt(4)) print(log(1)) print(log10(10)) print(exp(1)) -print(pow(9, 3)) \ No newline at end of file +print(pow(9, 3)) +print(sin(1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 8e6e202..b1d692b 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -56,6 +56,7 @@ from sys import platform b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0" b"2.718281828459045" # exp(1) b"729.0" # pow(9, 3) + b"0.8414709848078965" # sin(1) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From bacdbe08a276b4131d07bcb5fc1fa1e7ff510069 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:56:00 +0800 Subject: [PATCH 19/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0cos=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 3 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 3999740..770cdfe 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -185,6 +185,7 @@ def 创建全局变量(argv=[], 文件名=''): 'exp': math.exp, 'pow': math.pow, 'sin': math.sin, + 'cos': math.cos, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 54f7240..6680e1a 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -34,3 +34,4 @@ print(log10(10)) print(exp(1)) print(pow(9, 3)) print(sin(1)) +print(cos(1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index b1d692b..dec4831 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -57,6 +57,7 @@ from sys import platform b"2.718281828459045" # exp(1) b"729.0" # pow(9, 3) b"0.8414709848078965" # sin(1) + b"0.5403023058681398" # cos(1) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From edd9db9d822c6af96febe53666a1139e2129b3fa Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 18:57:27 +0800 Subject: [PATCH 20/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0tan=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 3 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 770cdfe..9cca090 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -186,6 +186,7 @@ def 创建全局变量(argv=[], 文件名=''): 'pow': math.pow, 'sin': math.sin, 'cos': math.cos, + 'tan': math.tan, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 6680e1a..234c79c 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -35,3 +35,4 @@ print(exp(1)) print(pow(9, 3)) print(sin(1)) print(cos(1)) +print(tan(1)) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index dec4831..dbd1bb8 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -58,6 +58,7 @@ from sys import platform b"729.0" # pow(9, 3) b"0.8414709848078965" # sin(1) b"0.5403023058681398" # cos(1) + b"1.5574077246549023" # tan(1) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From ee18d3a8821ac19633a215c90e0a3c4108ea6989 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 19:00:30 +0800 Subject: [PATCH 21/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0asin=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 3 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 9cca090..6ad51b2 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -187,6 +187,7 @@ def 创建全局变量(argv=[], 文件名=''): 'sin': math.sin, 'cos': math.cos, 'tan': math.tan, + 'asin': math.asin, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 234c79c..987e1dd 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -36,3 +36,4 @@ print(pow(9, 3)) print(sin(1)) print(cos(1)) print(tan(1)) +print(asin(1)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index dbd1bb8..72d2f8f 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -59,6 +59,7 @@ from sys import platform b"0.8414709848078965" # sin(1) b"0.5403023058681398" # cos(1) b"1.5574077246549023" # tan(1) + b"1.5707963267948966" # asin(1) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From e2027144ff93ea25dc7c720cee377e8f19beced6 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 19:03:01 +0800 Subject: [PATCH 22/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0acos=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 6ad51b2..c3c7e7c 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -188,6 +188,7 @@ def 创建全局变量(argv=[], 文件名=''): 'cos': math.cos, 'tan': math.tan, 'asin': math.asin, + 'acos': math.acos, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 987e1dd..53e811c 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -36,4 +36,5 @@ print(pow(9, 3)) print(sin(1)) print(cos(1)) print(tan(1)) -print(asin(1)) \ No newline at end of file +print(asin(1)) +print(acos(0)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 72d2f8f..632acfe 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -60,6 +60,7 @@ from sys import platform b"0.5403023058681398" # cos(1) b"1.5574077246549023" # tan(1) b"1.5707963267948966" # asin(1) + b"1.5707963267948966" # acos(0) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 0b365eac6541ac8a9eb263ad943d431a9eed4cf7 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 19:04:44 +0800 Subject: [PATCH 23/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0atan=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index c3c7e7c..afc788d 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -189,6 +189,7 @@ def 创建全局变量(argv=[], 文件名=''): 'tan': math.tan, 'asin': math.asin, 'acos': math.acos, + 'atan': math.atan, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 53e811c..cadcdbc 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -37,4 +37,5 @@ print(sin(1)) print(cos(1)) print(tan(1)) print(asin(1)) -print(acos(0)) \ No newline at end of file +print(acos(0)) +print(atan(1)) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 632acfe..aa1a8bb 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -61,6 +61,7 @@ from sys import platform b"1.5574077246549023" # tan(1) b"1.5707963267948966" # asin(1) b"1.5707963267948966" # acos(0) + b"0.7853981633974483" # atan(1) ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 8421161a726b48b00f4b1b73ac3fcd5bab87c342 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 19:23:48 +0800 Subject: [PATCH 24/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0spawn=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 7 +++++++ .../API/\345\206\205\347\275\256.ul" | 4 +++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index afc788d..c34cb24 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -131,6 +131,12 @@ def 创建全局变量(argv=[], 文件名=''): """ 当前任务 ID """ return threading.currentThread() + def builtin_spawn(target, *参数列表): + """ 生成一个新任务 """ + 私有线程 = threading.Thread(target=target, args=参数列表, daemon=True) + 私有线程.start() + return 私有线程 + def eval_print(expr): if expr is None: return @@ -190,6 +196,7 @@ def 创建全局变量(argv=[], 文件名=''): 'asin': math.asin, 'acos': math.acos, 'atan': math.atan, + 'spawn': builtin_spawn, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index cadcdbc..1f941f7 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -38,4 +38,6 @@ print(cos(1)) print(tan(1)) print(asin(1)) print(acos(0)) -print(atan(1)) \ No newline at end of file +print(atan(1)) +func pr(v) { print(v) } +t = spawn(pr, 'a') \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index aa1a8bb..aaa3700 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -62,6 +62,7 @@ from sys import platform b"1.5707963267948966" # asin(1) b"1.5707963267948966" # acos(0) b"0.7853981633974483" # atan(1) + b"a" ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 01342bc44567b7d1f6c93f2ae788140fb9ecfb71 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 19:59:58 +0800 Subject: [PATCH 25/49] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=BB=A7=E6=89=BF?= =?UTF-8?q?=E7=9A=84=E7=BA=BF=E7=A8=8B=E7=B1=BB=E6=B5=8B=E8=AF=95spawn?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=8F=8Akill=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 45 ++++++++++++++++++- .../API/\345\206\205\347\275\256.ul" | 11 ++++- ...37\346\234\233\345\200\274\350\241\250.py" | 5 ++- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index c34cb24..b79e6a7 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -8,6 +8,40 @@ from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 +class Thread(threading.Thread): + """ + A traced thread wrapper. + """ + + def __init__(self, *args, **kw): + threading.Thread.__init__(self, *args, **kw) + self.killed = False + + def start(self): + self._Thread__run_backup = self.run + self.run = self._Thread__run + threading.Thread.start(self) + + def __run(self): + sys.settrace(self.globaltrace) + self._Thread__run_backup() + self.run = self._Thread__run_backup + + def globaltrace(self, frame, event, arg): + if event == 'call': + return self.localtrace + return + + def localtrace(self, frame, event, arg): + if self.killed: + if event == 'line': + raise SystemExit + return self.localtrace + + def kill(self): + self.killed = True + + def 分析并编译(源码文件名): with open(源码文件名, 'r', encoding='utf-8') as 文件: 源码 = 文件.read() @@ -133,10 +167,18 @@ def 创建全局变量(argv=[], 文件名=''): def builtin_spawn(target, *参数列表): """ 生成一个新任务 """ - 私有线程 = threading.Thread(target=target, args=参数列表, daemon=True) + 私有线程 = Thread(target=target, args=参数列表, daemon=True) 私有线程.start() return 私有线程 + def builtin_kill(th): + """ 杀死th线程 """ + if isinstance(th, Thread): + if th == threading.currentThread(): + sys.exit() + elif th.isAlive(): + th.kill() + def eval_print(expr): if expr is None: return @@ -197,6 +239,7 @@ def 创建全局变量(argv=[], 文件名=''): 'acos': math.acos, 'atan': math.atan, 'spawn': builtin_spawn, + 'kill': builtin_kill, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 1f941f7..b770f9e 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -23,7 +23,7 @@ dic = dict({'a':1}) for k in dic { print(k, dic[k]) } -print(ord('好')) +print(ord('1')) print(typeof(1)) print(ceil(1.1)) print(floor(1.1)) @@ -40,4 +40,11 @@ print(asin(1)) print(acos(0)) print(atan(1)) func pr(v) { print(v) } -t = spawn(pr, 'a') \ No newline at end of file +t = spawn(pr, 'a') +using time +func tf() { + time.sleep(1000) + print('no kill') +} +tr = spawn(tf) +kill(tr) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index aaa3700..c238982 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -53,7 +53,7 @@ from sys import platform "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", "函数/API/内置.ul": ( - b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 122909int211.02.00.01.0" + b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 149int211.02.00.01.0" b"2.718281828459045" # exp(1) b"729.0" # pow(9, 3) b"0.8414709848078965" # sin(1) @@ -62,7 +62,8 @@ from sys import platform b"1.5707963267948966" # asin(1) b"1.5707963267948966" # acos(0) b"0.7853981633974483" # atan(1) - b"a" + b"a" # spawn + b"" # kill ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 41bd147f072c4cacf64a2e9cd251dac7b561f685 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:30:53 +0800 Subject: [PATCH 26/49] =?UTF-8?q?instll=E4=BD=BF=E7=94=A8=E4=BA=86pip?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=97=B6=E5=8F=AA=E4=BD=BF=E7=94=A8=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E8=BF=87=E7=A8=8B=20=E5=8E=9F=E5=A7=8B=E8=BE=93?= =?UTF-8?q?=E5=87=BA=EF=BC=9A=20install=20ERROR:=20You=20must=20give=20at?= =?UTF-8?q?=20least=20one=20requirement=20to=20install=20(see=20"pip=20hel?= =?UTF-8?q?p=20install")=20=E5=BD=93=E5=89=8D=E8=BE=93=E5=87=BA=EF=BC=9A?= =?UTF-8?q?=20WARNING:=20pip=20is=20being=20invoked=20by=20an=20old=20scri?= =?UTF-8?q?pt=20wrapper.=20This=20will=20fail=20in=20a=20future=20version?= =?UTF-8?q?=20of=20pip.=20Please=20see=20https://github.com/pypa/pip/issue?= =?UTF-8?q?s/5599=20for=20advice=20on=20fixing=20the=20underlying=20issue.?= =?UTF-8?q?=20To=20avoid=20this=20problem=20you=20can=20invoke=20Python=20?= =?UTF-8?q?with=20'-m=20pip'=20instead=20of=20running=20pip=20directly.=20?= =?UTF-8?q?ERROR:=20You=20must=20give=20at=20least=20one=20requirement=20t?= =?UTF-8?q?o=20install=20(see=20"pip=20help=20install")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 6 ++++++ 1 file changed, 6 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index b79e6a7..1eecb1d 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -179,6 +179,11 @@ def 创建全局变量(argv=[], 文件名=''): elif th.isAlive(): th.kill() + def pip_install(*packages, cmd='install'): + """ Trigger a pip command. """ + import pip._internal + return pip._internal.main([cmd, *packages]) + def eval_print(expr): if expr is None: return @@ -244,6 +249,7 @@ def 创建全局变量(argv=[], 文件名=''): '再会': sys.exit, 'quit': sys.exit, 'open': open, + 'install': pip_install, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, -- Gitee From a0c94d2f16d8601bc9e03132d9ccdb9a0a46f691 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:39:33 +0800 Subject: [PATCH 27/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0time=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 4 +++- .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 1eecb1d..a4c60e5 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -2,6 +2,7 @@ import imp import math import os import sys +import time import threading from pathlib import Path @@ -176,7 +177,7 @@ def 创建全局变量(argv=[], 文件名=''): if isinstance(th, Thread): if th == threading.currentThread(): sys.exit() - elif th.isAlive(): + elif th.is_alive(): th.kill() def pip_install(*packages, cmd='install'): @@ -250,6 +251,7 @@ def 创建全局变量(argv=[], 文件名=''): 'quit': sys.exit, 'open': open, 'install': pip_install, + 'time': time.time, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index b770f9e..f190b29 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -39,6 +39,7 @@ print(tan(1)) print(asin(1)) print(acos(0)) print(atan(1)) +print(str(time())[:2]) func pr(v) { print(v) } t = spawn(pr, 'a') using time diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index c238982..9dfee70 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -62,6 +62,7 @@ from sys import platform b"1.5707963267948966" # asin(1) b"1.5707963267948966" # acos(0) b"0.7853981633974483" # atan(1) + b"16" # str(time())[:2] b"a" # spawn b"" # kill ), -- Gitee From 246c8d16ca372cba0eee7c6adb5e763f7927a22e Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:44:27 +0800 Subject: [PATCH 28/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0year=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 2 ++ .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 1 + .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 1 + 3 files changed, 4 insertions(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index a4c60e5..6fbbafe 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -4,6 +4,7 @@ import os import sys import time import threading +from datetime import datetime from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 @@ -252,6 +253,7 @@ def 创建全局变量(argv=[], 文件名=''): 'open': open, 'install': pip_install, 'time': time.time, + 'year': lambda: datetime.now().year, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index f190b29..bd493ea 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -49,3 +49,4 @@ func tf() { } tr = spawn(tf) kill(tr) +print(year()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 9dfee70..2eef511 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -65,6 +65,7 @@ from sys import platform b"16" # str(time())[:2] b"a" # spawn b"" # kill + b"2021" # year ), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 16916dae29e0b64fd2441647aae3dc4853cd82f9 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:55:06 +0800 Subject: [PATCH 29/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0month=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 1 + .../API/\345\206\205\347\275\256.ul" | 3 +- ...37\346\234\233\345\200\274\350\241\250.py" | 33 +++++++++++-------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 6fbbafe..b3d915c 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -254,6 +254,7 @@ def 创建全局变量(argv=[], 文件名=''): 'install': pip_install, 'time': time.time, 'year': lambda: datetime.now().year, + 'month': lambda: datetime.now().month, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index bd493ea..b60a7ea 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -49,4 +49,5 @@ func tf() { } tr = spawn(tf) kill(tr) -print(year()) \ No newline at end of file +print(year()) +print(month()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 2eef511..5db1f46 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -1,4 +1,5 @@ from sys import platform +import datetime 为win系统 = platform == 'win32' @@ -53,20 +54,24 @@ from sys import platform "函数/返回多值.ul": b"12", # TODO: 原本元组输出为 1, 2, 而非(1,2) "函数/匿名函数.ul": b"[1][1][3][3][1, 4]12true", "函数/API/内置.ul": ( - b"truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{}true1.1a 149int211.02.00.01.0" - b"2.718281828459045" # exp(1) - b"729.0" # pow(9, 3) - b"0.8414709848078965" # sin(1) - b"0.5403023058681398" # cos(1) - b"1.5574077246549023" # tan(1) - b"1.5707963267948966" # asin(1) - b"1.5707963267948966" # acos(0) - b"0.7853981633974483" # atan(1) - b"16" # str(time())[:2] - b"a" # spawn - b"" # kill - b"2021" # year - ), + "truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{{}}true1.1a 149int211.02.00.01.0" + "2.718281828459045" # exp(1) + "729.0" # pow(9, 3) + "0.8414709848078965" # sin(1) + "0.5403023058681398" # cos(1) + "1.5574077246549023" # tan(1) + "1.5707963267948966" # asin(1) + "1.5707963267948966" # acos(0) + "0.7853981633974483" # atan(1) + "16" # str(time())[:2] + "a" # spawn + "" # kill + "{}" # year + "{}" # month + ).format( + datetime.datetime.now().year, + datetime.datetime.now().month, + ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", "函数/API/file.ul": b"true", -- Gitee From 090dae9e8b3c9219081fd8e4fbdf31e9dff7af20 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:56:33 +0800 Subject: [PATCH 30/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0day=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index b3d915c..57bef72 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -255,6 +255,7 @@ def 创建全局变量(argv=[], 文件名=''): 'time': time.time, 'year': lambda: datetime.now().year, 'month': lambda: datetime.now().month, + 'day': lambda: datetime.now().day, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index b60a7ea..4f16dca 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -50,4 +50,5 @@ func tf() { tr = spawn(tf) kill(tr) print(year()) -print(month()) \ No newline at end of file +print(month()) +print(day()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 5db1f46..1797db5 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -68,9 +68,11 @@ import datetime "" # kill "{}" # year "{}" # month + "{}" # day ).format( datetime.datetime.now().year, datetime.datetime.now().month, + datetime.datetime.now().day, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 541e0d65e1fb6716a6f6b7fe710df51cadc78c90 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 20:58:00 +0800 Subject: [PATCH 31/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0hour=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 57bef72..2940bd7 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -256,6 +256,7 @@ def 创建全局变量(argv=[], 文件名=''): 'year': lambda: datetime.now().year, 'month': lambda: datetime.now().month, 'day': lambda: datetime.now().day, + 'hour': lambda: datetime.now().hour, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 4f16dca..54d8916 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -51,4 +51,5 @@ tr = spawn(tf) kill(tr) print(year()) print(month()) -print(day()) \ No newline at end of file +print(day()) +print(hour()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 1797db5..4e80d26 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -69,10 +69,12 @@ import datetime "{}" # year "{}" # month "{}" # day + "{}" # hour ).format( datetime.datetime.now().year, datetime.datetime.now().month, datetime.datetime.now().day, + datetime.datetime.now().hour, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From a31ae9014774d57e5378c44fe2378f34970c0683 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:00:51 +0800 Subject: [PATCH 32/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0minute=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 2940bd7..044bbc4 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -257,6 +257,7 @@ def 创建全局变量(argv=[], 文件名=''): 'month': lambda: datetime.now().month, 'day': lambda: datetime.now().day, 'hour': lambda: datetime.now().hour, + 'minute': lambda: datetime.now().minute, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 54d8916..9cfbe42 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -52,4 +52,5 @@ kill(tr) print(year()) print(month()) print(day()) -print(hour()) \ No newline at end of file +print(hour()) +print(minute()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 4e80d26..2b3a5a4 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -70,11 +70,13 @@ import datetime "{}" # month "{}" # day "{}" # hour + "{}" # minute ).format( datetime.datetime.now().year, datetime.datetime.now().month, datetime.datetime.now().day, datetime.datetime.now().hour, + datetime.datetime.now().minute, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 505cc9aa8c421666cc93c236f882a00816c665cb Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:03:27 +0800 Subject: [PATCH 33/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0second=E5=87=BD?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 044bbc4..79f757d 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -258,6 +258,7 @@ def 创建全局变量(argv=[], 文件名=''): 'day': lambda: datetime.now().day, 'hour': lambda: datetime.now().hour, 'minute': lambda: datetime.now().minute, + 'second': lambda: datetime.now().second, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 9cfbe42..45614c1 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -53,4 +53,5 @@ print(year()) print(month()) print(day()) print(hour()) -print(minute()) \ No newline at end of file +print(minute()) +print(second()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 2b3a5a4..6ac42b3 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -71,12 +71,14 @@ import datetime "{}" # day "{}" # hour "{}" # minute + "{}" # second ).format( datetime.datetime.now().year, datetime.datetime.now().month, datetime.datetime.now().day, datetime.datetime.now().hour, datetime.datetime.now().minute, + datetime.datetime.now().second, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 4d2f18ad3113f1091dd1eb5bcea703df185251c1 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:05:59 +0800 Subject: [PATCH 34/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0microsecond=E5=87=BD?= =?UTF-8?q?=E6=95=B0=20=E6=AF=AB=E7=A7=92=E6=95=B0=E4=B8=8E=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=97=A0=E6=B3=95=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 79f757d..ea62ec3 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -259,6 +259,7 @@ def 创建全局变量(argv=[], 文件名=''): 'hour': lambda: datetime.now().hour, 'minute': lambda: datetime.now().minute, 'second': lambda: datetime.now().second, + 'microsecond': lambda: datetime.now().microsecond, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 45614c1..9195666 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -54,4 +54,5 @@ print(month()) print(day()) print(hour()) print(minute()) -print(second()) \ No newline at end of file +print(second()) +print(microsecond()) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 6ac42b3..99d74b7 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -72,6 +72,7 @@ import datetime "{}" # hour "{}" # minute "{}" # second + "{}" # microsecond ).format( datetime.datetime.now().year, datetime.datetime.now().month, @@ -79,6 +80,7 @@ import datetime datetime.datetime.now().hour, datetime.datetime.now().minute, datetime.datetime.now().second, + datetime.datetime.now().microsecond, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From b439ebcfbe1d46f778715540e8ff122382fa7b3e Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:07:14 +0800 Subject: [PATCH 35/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0sleep=E5=87=BD=E6=95=B0?= =?UTF-8?q?=20=E6=97=A0=E6=B3=95=E6=B5=8B=E8=AF=95=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index ea62ec3..1c4fd01 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -260,6 +260,7 @@ def 创建全局变量(argv=[], 文件名=''): 'minute': lambda: datetime.now().minute, 'second': lambda: datetime.now().second, 'microsecond': lambda: datetime.now().microsecond, + 'sleep': time.sleep, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, -- Gitee From dba6ae9c677745e4490639c978a864c82f4d53b6 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:09:20 +0800 Subject: [PATCH 36/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0delay=E5=87=BD=E6=95=B0?= =?UTF-8?q?=20=E6=97=A0=E6=B3=95=E6=B5=8B=E8=AF=95=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 1c4fd01..70c91bb 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -261,6 +261,7 @@ def 创建全局变量(argv=[], 文件名=''): 'second': lambda: datetime.now().second, 'microsecond': lambda: datetime.now().microsecond, 'sleep': time.sleep, + 'delay': lambda 毫秒数: time.sleep(毫秒数 / 1000), 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, -- Gitee From 8020b920e591c44be4e1e4678d8634710356ede7 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:11:59 +0800 Subject: [PATCH 37/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0delayMicroseconds?= =?UTF-8?q?=E5=87=BD=E6=95=B0=20=E6=97=A0=E6=B3=95=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 70c91bb..8567c2f 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -262,6 +262,7 @@ def 创建全局变量(argv=[], 文件名=''): 'microsecond': lambda: datetime.now().microsecond, 'sleep': time.sleep, 'delay': lambda 毫秒数: time.sleep(毫秒数 / 1000), + 'delayMicroseconds': lambda 微秒数: time.sleep(微秒数 / 1000000), 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, -- Gitee From 557a7da1e5500849a6c355de4fa8020d535e1ca5 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:15:18 +0800 Subject: [PATCH 38/49] =?UTF-8?q?=E6=B3=A8=E9=87=8AdelayMicroseconds?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=B5=8B=E8=AF=95=20=E6=B7=BB=E5=8A=A0PI?= =?UTF-8?q?=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 1 + .../API/\345\206\205\347\275\256.ul" | 3 ++- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 8567c2f..e584933 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -263,6 +263,7 @@ def 创建全局变量(argv=[], 文件名=''): 'sleep': time.sleep, 'delay': lambda 毫秒数: time.sleep(毫秒数 / 1000), 'delayMicroseconds': lambda 微秒数: time.sleep(微秒数 / 1000000), + 'PI': math.pi, 'ARGV': argv, '__builtins__': 内置扩展({ '__import__': 自定义导入, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 9195666..8d06fd9 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -55,4 +55,5 @@ print(day()) print(hour()) print(minute()) print(second()) -print(microsecond()) \ No newline at end of file +//print(microsecond()) +print(PI) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 99d74b7..43730c2 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -72,7 +72,8 @@ import datetime "{}" # hour "{}" # minute "{}" # second - "{}" # microsecond + # "{}" # microsecond + "3.141592653589793" # PI ).format( datetime.datetime.now().year, datetime.datetime.now().month, @@ -80,7 +81,7 @@ import datetime datetime.datetime.now().hour, datetime.datetime.now().minute, datetime.datetime.now().second, - datetime.datetime.now().microsecond, + # datetime.datetime.now().microsecond, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 841cb398b5a11461329fcc11839d222fa078def0 Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:41:27 +0800 Subject: [PATCH 39/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0globals=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\344\272\244\344\272\222.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\234\250\345\205\260/\344\272\244\344\272\222.py" "b/\346\234\250\345\205\260/\344\272\244\344\272\222.py" index 1b517b5..bc6b4a1 100644 --- "a/\346\234\250\345\205\260/\344\272\244\344\272\222.py" +++ "b/\346\234\250\345\205\260/\344\272\244\344\272\222.py" @@ -143,6 +143,7 @@ def 开始交互(提示符1='> ', 提示符2='>> ', 全局变量=None): # TODO: 何时会用 全局变量 = 创建全局变量(文件名='') 全局变量['详情'] = lambda : print('\n'.join([' %s (%s)' % (k, v.__class__.__name__) for k, v in 全局变量.items() if k != '__builtins__' if k != '___'])) + 全局变量['globals'] = lambda: 全局变量['详情']() 全局变量['你好'] = lambda *args: print('\n'.join(介绍)) if not args else print() 交互(提示符1, 提示符2, 全局变量).cmdloop("木兰向您问好\n更多信息请说'你好'") sys.exit(0) \ No newline at end of file -- Gitee From a986f6ef46e79bc8c5d84fa132ae983c782ccb6e Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:43:36 +0800 Subject: [PATCH 40/49] =?UTF-8?q?=E6=B7=BB=E5=8A=A0help=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\344\272\244\344\272\222.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\346\234\250\345\205\260/\344\272\244\344\272\222.py" "b/\346\234\250\345\205\260/\344\272\244\344\272\222.py" index bc6b4a1..862bc93 100644 --- "a/\346\234\250\345\205\260/\344\272\244\344\272\222.py" +++ "b/\346\234\250\345\205\260/\344\272\244\344\272\222.py" @@ -145,5 +145,6 @@ def 开始交互(提示符1='> ', 提示符2='>> ', 全局变量=None): 全局变量['详情'] = lambda : print('\n'.join([' %s (%s)' % (k, v.__class__.__name__) for k, v in 全局变量.items() if k != '__builtins__' if k != '___'])) 全局变量['globals'] = lambda: 全局变量['详情']() 全局变量['你好'] = lambda *args: print('\n'.join(介绍)) if not args else print() + 全局变量['help'] = lambda: 全局变量['你好']() 交互(提示符1, 提示符2, 全局变量).cmdloop("木兰向您问好\n更多信息请说'你好'") sys.exit(0) \ No newline at end of file -- Gitee From de9e18f0fc00fd7d59cd0bf9ce96f513e84084db Mon Sep 17 00:00:00 2001 From: fcfco Date: Sun, 16 May 2021 21:47:38 +0800 Subject: [PATCH 41/49] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=97=B6=E5=BE=AE?= =?UTF-8?q?=E7=A7=92=E4=B8=8E=E7=A7=92=E4=B8=8D=E5=90=8C=EF=BC=8C=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E6=AD=A4=E9=83=A8=E5=88=86=E4=BB=A5=E9=80=9A=E8=BF=87?= =?UTF-8?q?ulang=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 2 +- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 8d06fd9..bb1eceb 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -54,6 +54,6 @@ print(month()) print(day()) print(hour()) print(minute()) -print(second()) +//print(second()) //print(microsecond()) print(PI) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 43730c2..e5b2738 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -71,7 +71,7 @@ import datetime "{}" # day "{}" # hour "{}" # minute - "{}" # second + # "{}" # second # "{}" # microsecond "3.141592653589793" # PI ).format( @@ -80,7 +80,7 @@ import datetime datetime.datetime.now().day, datetime.datetime.now().hour, datetime.datetime.now().minute, - datetime.datetime.now().second, + # datetime.datetime.now().second, # datetime.datetime.now().microsecond, ).encode(), "函数/API/文件.ul": b"hi", -- Gitee From f6ebe8db1b127a289d1bccd3214618c186a9058b Mon Sep 17 00:00:00 2001 From: fcfco Date: Mon, 17 May 2021 10:34:23 +0800 Subject: [PATCH 42/49] =?UTF-8?q?=E8=B0=83=E6=95=B4locals=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8locals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index e584933..28663b9 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -210,7 +210,7 @@ def 创建全局变量(argv=[], 文件名=''): 'input': input, 'reverse': reversed, 'super': super, - 'locals': lambda: locals(), + 'locals': locals, 'bool': bool, 'float': float, 'int': int, -- Gitee From 8a452049b13d1dcad16b9c8adf6e695fcc58827c Mon Sep 17 00:00:00 2001 From: fcfco Date: Mon, 17 May 2021 10:48:25 +0800 Subject: [PATCH 43/49] =?UTF-8?q?=E5=9B=A0=E6=AD=A4=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E8=A7=92=E5=BA=A6=E8=A7=84=E9=81=BF=E4=B8=89?= =?UTF-8?q?=E8=A7=92=E5=87=BD=E6=95=B0=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20=E4=B8=BA=E4=B8=8E=E8=AF=AD=E8=A8=80=E7=9B=B8=E5=90=8C?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9'locals':=20lambda:=20locals(),?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 2 +- .../API/\345\206\205\347\275\256.ul" | 17 +++++++++-------- ...\237\346\234\233\345\200\274\350\241\250.py" | 16 ++++++++-------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 28663b9..e584933 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -210,7 +210,7 @@ def 创建全局变量(argv=[], 文件名=''): 'input': input, 'reverse': reversed, 'super': super, - 'locals': locals, + 'locals': lambda: locals(), 'bool': bool, 'float': float, 'int': int, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index bb1eceb..415b225 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -33,12 +33,13 @@ print(log(1)) print(log10(10)) print(exp(1)) print(pow(9, 3)) -print(sin(1)) -print(cos(1)) -print(tan(1)) -print(asin(1)) -print(acos(0)) -print(atan(1)) +// 不同 python3.7小版本的值不同,如 3.7.9 cos(1) 0.5403023058681397 3.7.4 为 0.5403023058681398。因此使用特殊角度规避 +print('sin(0):' + str(sin(0))) +print('cos(0):' + str(cos(0))) +print('tan(0):' + str(tan(0))) +print('asin(0):' + str(asin(0))) +print('acos(1):' + str(acos(1))) +print('atan(0):' + str(atan(0))) print(str(time())[:2]) func pr(v) { print(v) } t = spawn(pr, 'a') @@ -54,6 +55,6 @@ print(month()) print(day()) print(hour()) print(minute()) -//print(second()) -//print(microsecond()) +print(typeof(second)) +print(typeof(microsecond)) print(PI) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index e5b2738..57b6769 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -57,12 +57,12 @@ import datetime "truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{{}}true1.1a 149int211.02.00.01.0" "2.718281828459045" # exp(1) "729.0" # pow(9, 3) - "0.8414709848078965" # sin(1) - "0.5403023058681398" # cos(1) - "1.5574077246549023" # tan(1) - "1.5707963267948966" # asin(1) - "1.5707963267948966" # acos(0) - "0.7853981633974483" # atan(1) + "sin(0):0.0" # sin(0) + "cos(0):1.0" # cos(0) + "tan(0):0.0" # tan(0) + "asin(0):0.0" # asin(0) + "acos(1):0.0" # acos(1) + "atan(0):0.0" # atan(0) "16" # str(time())[:2] "a" # spawn "" # kill @@ -71,8 +71,8 @@ import datetime "{}" # day "{}" # hour "{}" # minute - # "{}" # second - # "{}" # microsecond + "function" # typeof(second) + "function" # typeof(microsecond) "3.141592653589793" # PI ).format( datetime.datetime.now().year, -- Gitee From a97b1632e862692ff02f37e302b0ffb11801fe27 Mon Sep 17 00:00:00 2001 From: fcfco Date: Mon, 17 May 2021 11:19:10 +0800 Subject: [PATCH 44/49] =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=87=BD=E6=95=B0=E5=90=8D=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index e584933..ce5ad4b 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -12,7 +12,7 @@ from 木兰.分析器.语法分析器 import 语法分析器 class Thread(threading.Thread): """ - A traced thread wrapper. + 跟踪线程包装器。 """ def __init__(self, *args, **kw): @@ -167,19 +167,19 @@ def 创建全局变量(argv=[], 文件名=''): """ 当前任务 ID """ return threading.currentThread() - def builtin_spawn(target, *参数列表): + def 生成新任务(任务名, *参数列表): """ 生成一个新任务 """ - 私有线程 = Thread(target=target, args=参数列表, daemon=True) + 私有线程 = Thread(target=任务名, args=参数列表, daemon=True) 私有线程.start() return 私有线程 - def builtin_kill(th): + def 杀死任务(任务线程): """ 杀死th线程 """ - if isinstance(th, Thread): - if th == threading.currentThread(): + if isinstance(任务线程, Thread): + if 任务线程 == threading.currentThread(): sys.exit() - elif th.is_alive(): - th.kill() + elif 任务线程.is_alive(): + 任务线程.kill() def pip_install(*packages, cmd='install'): """ Trigger a pip command. """ @@ -245,8 +245,8 @@ def 创建全局变量(argv=[], 文件名=''): 'asin': math.asin, 'acos': math.acos, 'atan': math.atan, - 'spawn': builtin_spawn, - 'kill': builtin_kill, + 'spawn': 生成新任务, + 'kill': 杀死任务, 'self': 内置自身, '再会': sys.exit, 'quit': sys.exit, -- Gitee From d46e5cb85abc8d36b451d9076aaedfb65e4d9bfb Mon Sep 17 00:00:00 2001 From: fcfco Date: Mon, 17 May 2021 12:49:39 +0800 Subject: [PATCH 45/49] =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E7=B1=BB=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=8C=96=20=E6=B8=85=E7=90=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BB=A3=E7=A0=81=E6=97=A0=E7=94=A8=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 53 +++++++++---------- .../API/\345\206\205\347\275\256.ul" | 1 - ...37\346\234\233\345\200\274\350\241\250.py" | 15 +++--- 3 files changed, 33 insertions(+), 36 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index ce5ad4b..6b05095 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -10,38 +10,38 @@ from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 -class Thread(threading.Thread): +class 线程包装器(threading.Thread): """ 跟踪线程包装器。 """ - def __init__(self, *args, **kw): - threading.Thread.__init__(self, *args, **kw) - self.killed = False + def __init__(类自身, *参数, **关键字): + threading.Thread.__init__(类自身, args=参数, kwargs=关键字) + 类自身.已杀死 = False - def start(self): - self._Thread__run_backup = self.run - self.run = self._Thread__run - threading.Thread.start(self) + def start(类自身): + 类自身._线程__运行_backup = 类自身.run + 类自身.run = 类自身._线程__运行 + threading.Thread.start(类自身) - def __run(self): - sys.settrace(self.globaltrace) - self._Thread__run_backup() - self.run = self._Thread__run_backup + def __运行(类自身): + sys.settrace(类自身.全局跟踪) + 类自身._线程__运行_backup() + 类自身.run = 类自身._线程__运行_backup - def globaltrace(self, frame, event, arg): - if event == 'call': - return self.localtrace + def 全局跟踪(类自身, 框架, 事件, 参数): + if 事件 == 'call': + return 类自身.本地跟踪 return - def localtrace(self, frame, event, arg): - if self.killed: - if event == 'line': + def 本地跟踪(类自身, 框架, 事件, 参数): + if 类自身.已杀死: + if 事件 == 'line': raise SystemExit - return self.localtrace + return 类自身.本地跟踪 - def kill(self): - self.killed = True + def 杀死(类自身): + 类自身.已杀死 = True def 分析并编译(源码文件名): @@ -169,7 +169,7 @@ def 创建全局变量(argv=[], 文件名=''): def 生成新任务(任务名, *参数列表): """ 生成一个新任务 """ - 私有线程 = Thread(target=任务名, args=参数列表, daemon=True) + 私有线程 = 线程包装器(target=任务名, 参数=参数列表, daemon=True) 私有线程.start() return 私有线程 @@ -179,12 +179,11 @@ def 创建全局变量(argv=[], 文件名=''): if 任务线程 == threading.currentThread(): sys.exit() elif 任务线程.is_alive(): - 任务线程.kill() + 任务线程.杀死() - def pip_install(*packages, cmd='install'): - """ Trigger a pip command. """ + def 用pip安装(*包, 命令='install'): import pip._internal - return pip._internal.main([cmd, *packages]) + return pip._internal.main([命令, *包]) def eval_print(expr): if expr is None: @@ -251,7 +250,7 @@ def 创建全局变量(argv=[], 文件名=''): '再会': sys.exit, 'quit': sys.exit, 'open': open, - 'install': pip_install, + 'install': 用pip安装, 'time': time.time, 'year': lambda: datetime.now().year, 'month': lambda: datetime.now().month, diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 415b225..5871c60 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -33,7 +33,6 @@ print(log(1)) print(log10(10)) print(exp(1)) print(pow(9, 3)) -// 不同 python3.7小版本的值不同,如 3.7.9 cos(1) 0.5403023058681397 3.7.4 为 0.5403023058681398。因此使用特殊角度规避 print('sin(0):' + str(sin(0))) print('cos(0):' + str(cos(0))) print('tan(0):' + str(tan(0))) diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 57b6769..0884abb 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -57,12 +57,13 @@ import datetime "truefalsea[1]200 a1 b2 ctruefalse32b'ab'12.55cba{{}}true1.1a 149int211.02.00.01.0" "2.718281828459045" # exp(1) "729.0" # pow(9, 3) - "sin(0):0.0" # sin(0) - "cos(0):1.0" # cos(0) - "tan(0):0.0" # tan(0) - "asin(0):0.0" # asin(0) - "acos(1):0.0" # acos(1) - "atan(0):0.0" # atan(0) + # 不同 python3.7小版本的值不同,如 3.7.9 cos(1) 0.5403023058681397 3.7.4 为 0.5403023058681398。因此使用特殊角度规避 + "sin(0):0.0" + "cos(0):1.0" + "tan(0):0.0" + "asin(0):0.0" + "acos(1):0.0" + "atan(0):0.0" "16" # str(time())[:2] "a" # spawn "" # kill @@ -80,8 +81,6 @@ import datetime datetime.datetime.now().day, datetime.datetime.now().hour, datetime.datetime.now().minute, - # datetime.datetime.now().second, - # datetime.datetime.now().microsecond, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee From 6e6176294bf218d320a8181d9bc4740a72e5e655 Mon Sep 17 00:00:00 2001 From: fcfco Date: Mon, 17 May 2021 12:51:57 +0800 Subject: [PATCH 46/49] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=80=E6=AD=BB?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E5=87=BD=E6=95=B0=E4=B8=AD=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\346\234\250\345\205\260/\347\216\257\345\242\203.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 6b05095..02a71d0 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -175,7 +175,7 @@ def 创建全局变量(argv=[], 文件名=''): def 杀死任务(任务线程): """ 杀死th线程 """ - if isinstance(任务线程, Thread): + if isinstance(任务线程, 线程包装器): if 任务线程 == threading.currentThread(): sys.exit() elif 任务线程.is_alive(): -- Gitee From e8e859d9b83087694730704ccca6c7d078a47b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=83=9C?= Date: Sun, 16 May 2021 23:24:28 -0700 Subject: [PATCH 47/49] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=EF=BC=8C=E5=9B=9E=E9=80=80=E9=83=A8=E5=88=86=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\347\216\257\345\242\203.py" | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index 02a71d0..c5f2f72 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -10,13 +10,13 @@ from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 -class 线程包装器(threading.Thread): +class 线程(threading.Thread): """ 跟踪线程包装器。 """ - def __init__(类自身, *参数, **关键字): - threading.Thread.__init__(类自身, args=参数, kwargs=关键字) + def __init__(类自身, *args, **kw): + threading.Thread.__init__(类自身, *args, **kw) 类自身.已杀死 = False def start(类自身): @@ -168,14 +168,14 @@ def 创建全局变量(argv=[], 文件名=''): return threading.currentThread() def 生成新任务(任务名, *参数列表): - """ 生成一个新任务 """ - 私有线程 = 线程包装器(target=任务名, 参数=参数列表, daemon=True) + + # 待研究:各参数作用 + 私有线程 = 线程(target=任务名, args=参数列表, daemon=True) 私有线程.start() return 私有线程 def 杀死任务(任务线程): - """ 杀死th线程 """ - if isinstance(任务线程, 线程包装器): + if isinstance(任务线程, 线程): if 任务线程 == threading.currentThread(): sys.exit() elif 任务线程.is_alive(): -- Gitee From 694a792e1f772158de6d26e44dbbaf312db9407b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=83=9C?= Date: Sun, 16 May 2021 23:29:09 -0700 Subject: [PATCH 48/49] =?UTF-8?q?=E6=B6=A6=E8=89=B2=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=BA=BF=E7=A8=8B=E7=9B=B8=E5=85=B3=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...57\350\257\255\350\257\215\345\205\270.md" | 3 ++ .../\347\216\257\345\242\203.py" | 38 +++++++++---------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git "a/\346\226\207\346\241\243/\346\234\257\350\257\255\350\257\215\345\205\270.md" "b/\346\226\207\346\241\243/\346\234\257\350\257\255\350\257\215\345\205\270.md" index 3f0f704..e4606b3 100644 --- "a/\346\226\207\346\241\243/\346\234\257\350\257\255\350\257\215\345\205\270.md" +++ "b/\346\226\207\346\241\243/\346\234\257\350\257\255\350\257\215\345\205\270.md" @@ -83,3 +83,6 @@ Attribute | 属性 | AttributeError 片 | slice 键值对 | kv_pair 字典表达式 | dict_expr +frame | 栈 +trace | 跟踪 +self | 自身 diff --git "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" index c5f2f72..1070849 100644 --- "a/\346\234\250\345\205\260/\347\216\257\345\242\203.py" +++ "b/\346\234\250\345\205\260/\347\216\257\345\242\203.py" @@ -9,39 +9,39 @@ from pathlib import Path from 木兰.分析器.语法分析器 import 语法分析器 - +# 参考:https://docs.python.org/3.7/library/threading.html#thread-objects class 线程(threading.Thread): """ 跟踪线程包装器。 """ - def __init__(类自身, *args, **kw): - threading.Thread.__init__(类自身, *args, **kw) - 类自身.已杀死 = False + def __init__(自身, *args, **kw): + threading.Thread.__init__(自身, *args, **kw) + 自身.已亡 = False - def start(类自身): - 类自身._线程__运行_backup = 类自身.run - 类自身.run = 类自身._线程__运行 - threading.Thread.start(类自身) + def start(自身): + 自身._线程__运行_backup = 自身.run + 自身.run = 自身._线程__运行 + threading.Thread.start(自身) - def __运行(类自身): - sys.settrace(类自身.全局跟踪) - 类自身._线程__运行_backup() - 类自身.run = 类自身._线程__运行_backup + def __运行(自身): + sys.settrace(自身.全局跟踪) + 自身._线程__运行_backup() + 自身.run = 自身._线程__运行_backup - def 全局跟踪(类自身, 框架, 事件, 参数): + def 全局跟踪(自身, 栈, 事件, 参数): if 事件 == 'call': - return 类自身.本地跟踪 + return 自身.本地跟踪 return - def 本地跟踪(类自身, 框架, 事件, 参数): - if 类自身.已杀死: + def 本地跟踪(自身, 栈, 事件, 参数): + if 自身.已亡: if 事件 == 'line': raise SystemExit - return 类自身.本地跟踪 + return 自身.本地跟踪 - def 杀死(类自身): - 类自身.已杀死 = True + def 杀死(自身): + 自身.已亡 = True def 分析并编译(源码文件名): -- Gitee From 50c1b66d7d89111f2bbb1a841ee5d9eb09233452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=83=9C?= Date: Mon, 17 May 2021 01:00:07 -0700 Subject: [PATCH 49/49] =?UTF-8?q?=E9=80=9A=E8=BF=87=20win=20=E4=B8=8B?= =?UTF-8?q?=E5=8E=9F=E5=A7=8B=E5=8F=AF=E6=89=A7=E8=A1=8C=E6=96=87=E4=BB=B6?= =?UTF-8?q?'=E8=BF=90=E8=A1=8C=E6=89=80=E6=9C=89'=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\345\276\205\345\206\263\351\227\256\351\242\230.md" | 3 ++- .../\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" | 2 +- .../\346\234\237\346\234\233\345\200\274\350\241\250.py" | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git "a/\346\226\207\346\241\243/\345\276\205\345\206\263\351\227\256\351\242\230.md" "b/\346\226\207\346\241\243/\345\276\205\345\206\263\351\227\256\351\242\230.md" index 3a7cc88..8fed063 100644 --- "a/\346\226\207\346\241\243/\345\276\205\345\206\263\351\227\256\351\242\230.md" +++ "b/\346\226\207\346\241\243/\345\276\205\345\206\263\351\227\256\351\242\230.md" @@ -6,7 +6,8 @@ #### 待确认 -- win 下运行生成测试 +- 完善线程和 sleep/delay/delayMicroseconds 相关测试 +- win 下通过报错、生成测试 - 由于 rply 支持 | (见 commit 41d748),导致 | 语法规则出错 - 多个父类使用 super() 时与 python 的行为比较 - 无 sorted 内置函数,只能用列表的 .sort() ? diff --git "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" index 5871c60..1b8daa8 100644 --- "a/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" +++ "b/\346\265\213\350\257\225/\345\207\275\346\225\260/API/\345\206\205\347\275\256.ul" @@ -53,7 +53,7 @@ print(year()) print(month()) print(day()) print(hour()) -print(minute()) +print(typeof(minute)) print(typeof(second)) print(typeof(microsecond)) print(PI) \ No newline at end of file diff --git "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" index 0884abb..2f1eab4 100644 --- "a/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" +++ "b/\346\265\213\350\257\225/\346\234\237\346\234\233\345\200\274\350\241\250.py" @@ -71,7 +71,8 @@ import datetime "{}" # month "{}" # day "{}" # hour - "{}" # minute + # 当原始可执行文件运行测试时间过长,常导致开始测试时刻的分钟数值与运行到此测试的分钟数值不同 + "function" # typeof(minute) "function" # typeof(second) "function" # typeof(microsecond) "3.141592653589793" # PI @@ -80,7 +81,6 @@ import datetime datetime.datetime.now().month, datetime.datetime.now().day, datetime.datetime.now().hour, - datetime.datetime.now().minute, ).encode(), "函数/API/文件.ul": b"hi", "函数/API/self.ul": b"true", -- Gitee