code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
# This file is Copyright 2011 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.7826, 0.0435, 0, 0.66, 0, 297, 0, 1, 0, 0, 297, 0, 0 ], [ 1, 0, 0.8261, 0.0435, 0, 0.66, 0.5, 686, 0, 1, 0, 0, 686, 0, 0 ], [ 8, 0, 0.913, 0.0435, 0, 0.66...
[ "from t378e import the_list", "import t378f", "print(\"the_list[0] =\", the_list[0])" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.72, 0.04, 0, 0.66, 0, 355, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.76, 0.04, 0, 0.66, 0.5, 0, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.92, 0.04, 0, 0.66, 2, 4...
[ "d = {}", "d[0] = 42", "r = range(3)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.6143, 0.0571, 0, 0.66, 0, 541, 0, 1, 1, 0, 0, 0, 0 ], [ 13, 1, 0.6286, 0.0286, 1, 0.22, 0, 0, 1, 0, 0, 0, 0, 9, 0 ], [ 14, 0, 0.6857, 0.0286, 0, 0.66, ...
[ "def noneify(a):\n return None", " return None", "r = map(noneify, \"test\")", "def addPair(a):\n return a[0] + a[1]", " return a[0] + a[1]", "r = map(addPair, ((3,4),(5,6),(7,8)))" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.4634, 0.0244, 0, 0.66, 0, 329, 0, 0, 0, 0, 0, 8, 0 ], [ 4, 0, 0.5, 0.0488, 0, 0.66, 0.0909, 0, 2, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.561, 0.0244, 0, 0.66, ...
[ "t1 = ()", "if t1:\n assert 0", "t2 = (2,)", "if not t2:\n assert 0", "l1 = []", "if l1:\n assert 0", "l2 = [2,]", "if not l2:\n assert 0", "d1 = {}", "if d1:\n assert 0", "d2 = {2:2}", "if not d2:\n assert 0" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 4, 0, 0.9286, 0.1905, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.0476, 1, 0.46, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "if None:\n assert False\nelse:\n print(\"None is False. Passed.\")", " print(\"None is False. Passed.\")" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.3854, 0.0417, 0, 0.66, 0, 331, 0, 3, 1, 0, 0, 0, 0 ], [ 13, 1, 0.3958, 0.0208, 1, 0.04, 0, 0, 0, 0, 0, 0, 0, 8, 0 ], [ 8, 0, 0.4375, 0.0208, 0, 0.66, ...
[ "def foo1(a=42, b=6, c=7):\n return (a, b, c)", " return (a, b, c)", "print(\"foo1()=\", foo1())", "def foo2(a, b=6, c=7):\n return (a, b, c)", " return (a, b, c)", "print(\"foo2(42)=\", foo2(42))", "def foo3(a, b, c=7):\n return (a, b, c)", " return (a, b, c)", "print(\"foo3(42, 6...
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.5625, 0.0312, 0, 0.66, 0, 745, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.5938, 0.0312, 0, 0.66, 0.2, 448, 4, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.625, 0.0312, 0, 0.66,...
[ "s1 = \"\\0\"", "s2 = \"a\" + s1", "s3 = s2 + \"a\"", "s2 = s1 + \"a\"", "s3 = s2 + \"\\0\"", "s2 = \"let's \\0 try\" + s1 + \"something else\\0\"" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 3, 0, 0.75, 0.0769, 0, 0.66, 0, 619, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.8462, 0.0385, 0, 0.66, 0.3333, 411, 3, 0, 0, 0, 619, 10, 1 ], [ 8, 0, 0.9231, 0.0385, 0, 0....
[ "class C():\n pass", "c = C()", "print(\"Expect TypeError:\")", "for i in c:\n print(i)", " print(i)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.322, 0.0169, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 3, 0, 0.3559, 0.0508, 0, 0.66, 0.0769, 567, 0, 1, 0, 0, 186, 0, 1 ], [ 2, 1, 0.3644, 0.0339, 1, 0.7...
[ "print(\"testing Foo...\")", "class Foo(object):\n def foo(self,):\n print(\"In foo.\")", " def foo(self,):\n print(\"In foo.\")", " print(\"In foo.\")", "foo = Foo()", "foo.foo()", "print(\"testing Bar...\")", "class Bar(Foo):\n def __init__(self, val):\n self.v =...
# This file is Copyright 2011 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.9, 0.05, 0, 0.66, 0, 297, 0, 1, 0, 0, 297, 0, 0 ] ]
[ "from t378e import the_list" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.5556, 0.0278, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 0.6111, 0.0278, 0, 0.66, 0.1111, 535, 3, 2, 0, 0, 0, 0, 2 ], [ 14, 0, 0.6944, 0.0278, 0, 0...
[ "import sys", "print(\"Heap =\", sys.heap())", "i = 140", "r = range(i)", "print(\"r = range(\", i, \")\")", "print(\"Heap =\", sys.heap())", "while i > 0:\n i -= 1\n r[i] += 10", "print(\"r[i] += 10; for all i\")", "print(\"Heap =\", sys.heap())", "print(\"Done.\")" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.4878, 0.0244, 0, 0.66, 0, 535, 3, 2, 0, 0, 0, 0, 2 ], [ 2, 0, 0.622, 0.0488, 0, 0.66, 0.2857, 528, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.6585, 0.0244, 0, 0.66...
[ "print(\"dir() = \",dir())", "def foo():\n pass", "d = dir()", "foo.bar = \"bar\"", "import sys", "d = dir()", "d = dir(sys)", "print(\"dir(sys) = \",d)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.8182, 0.0455, 0, 0.66, 0, 827, 0, 1, 0, 0, 827, 0, 0 ], [ 8, 0, 0.9091, 0.0455, 0, 0.66, 1, 535, 3, 2, 0, 0, 0, 0, 3 ] ]
[ "import dict", "print(\"dict.keys(globals()) = \", dict.keys(globals()))" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.4872, 0.0256, 0, 0.66, 0, 810, 3, 1, 0, 0, 816, 10, 1 ], [ 14, 0, 0.8462, 0.0256, 0, 0.66, 1.6667, 355, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.8718, 0.0256, 0, ...
[ "l = range(9)", "d = {}", "i = 9", "while i >= 0:\n d[i] = i\n i -= 1", " d[i] = i" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.6129, 0.0323, 0, 0.66, 0, 888, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.6452, 0.0323, 0, 0.66, 0.2, 40, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.7419, 0.0323, 0, 0.66,...
[ "l1 = [2,5,6]", "l2 = [2,5,6]", "l3 = [2,5,5]", "t1 = (2,5,6)", "t2 = (2,5,6)", "t3 = (2,5,5)" ]
# # NOTICE: This does not work yet. # import os vars = Variables() vars.args["PLATFORM"] = "desktop" vars.Add("IPM", "Add the interactive library to the standard lib", True) CFLAGS = "-g -ggdb -D__DEBUG__=1 -DHEAP_SIZE=$HEAP_SIZE " \ "-Os -Wall -gstabs -Wstrict-prototypes -Werror" #PY_SOURCES = ["main.py"]...
[ [ 1, 0, 0.1429, 0.0238, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 14, 0, 0.1905, 0.0238, 0, 0.66, 0.0769, 302, 3, 0, 0, 0, 821, 10, 1 ], [ 14, 0, 0.2143, 0.0238, 0, ...
[ "import os", "vars = Variables()", "vars.args[\"PLATFORM\"] = \"desktop\"", "vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)", "CFLAGS = \"-g -ggdb -D__DEBUG__=1 -DHEAP_SIZE=$HEAP_SIZE \" \\\n \"-Os -Wall -gstabs -Wstrict-prototypes -Werror\"", "PM_LIB_ROOT = [\"pmvm_%...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 4, 0, 0.9286, 0.1905, 0, 0.66, 0, 0, 3, 0, 0, 0, 0, 0, 3 ], [ 8, 1, 0.9048, 0.0476, 1, 0.27, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.0476, 1, 0.27, 1, ...
[ "if ismain():\n print(\"In main.\")\nelse:\n print(\"Not in main.\")", " print(\"In main.\")", " print(\"Not in main.\")" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.6429, 0.0357, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 0.75, 0.0357, 0, 0.66, 0.1667, 243, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.7857, 0.0357, 0, 0.66...
[ "import sys", "sys.wait(-1)", "sys.wait(0)", "sys.wait(1)", "print(\"Waiting 3 secs...\")", "sys.wait(3000)", "print(\"done.\")" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.6667, 0.037, 0, 0.66, 0, 827, 0, 1, 0, 0, 827, 0, 0 ], [ 14, 0, 0.7778, 0.037, 0, 0.66, 0.2, 355, 0, 0, 0, 0, 0, 6, 0 ], [ 8, 0, 0.8148, 0.037, 0, 0.66, ...
[ "import dict", "d = {0:\"zero\", \"one\":1}", "dict.clear(d)", "d[\"zero\"] = 0", "d[1] = \"one\"", "print(d)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.6029, 0.0588, 0, 0.66, 0, 331, 0, 2, 1, 0, 0, 0, 0 ], [ 13, 1, 0.6176, 0.0294, 1, 0.42, 0, 0, 4, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.75, 0.0588, 0, 0.66, 0....
[ "def foo1(a, *b):\n return a+b", " return a+b", "def foo2(a, **kwb):\n return a+b[42]", " return a+b[42]", "def foo3(a):\n i = 0\n while 1:\n yield i\n i += a", " i = 0", " while 1:\n yield i\n i += a", " yield i" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.7692, 0.0385, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.8077, 0.0385, 0, 0.66, 0.25, 190, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.8462, 0.0385, 0, 0.66...
[ "print(\"Thread A\")", "x = -42", "y = 12", "for i in range(10):\n x += i\n y -= i", "print(x*y)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.5135, 0.027, 0, 0.66, 0, 553, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.5405, 0.027, 0, 0.66, 0.125, 773, 1, 0, 0, 0, 0, 1, 0 ], [ 6, 0, 0.5946, 0.0811, 0, 0.66,...
[ "s = (2,5,6)", "n = 0", "for i in s:\n assert s[n] == i\n n += 1", "s = [2,5,6]", "n = 0", "for i in s:\n assert s[n] == i\n n += 1", "s = \"256\"", "n = 0", "for i in s:\n assert s[n] == i\n n += 1" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[]
[]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.6923, 0.0385, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 2, 0, 0.7885, 0.0769, 0, 0.66, 0.5, 899, 0, 2, 1, 0, 0, 0, 0 ], [ 13, 1, 0.8077, 0.0385, 1, 0.82...
[ "import sys", "def f(a,b):\n return a+b", " return a+b", "print(f, sys)" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.6296, 0.037, 0, 0.66, 0, 827, 0, 1, 0, 0, 827, 0, 0 ], [ 14, 0, 0.7407, 0.037, 0, 0.66, 0.3333, 355, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.8148, 0.037, 0, 0.6...
[ "import dict", "d = {0:None}", "r1 = dict.has_key(d, 0)", "r2 = dict.has_key(d, None)" ]
# This file is Copyright 2011 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 1, 0.0556, 0, 0.66, 0, 23, 0, 0, 0, 0, 0, 5, 0 ] ]
[ "the_list = [40]" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.3913, 0.0217, 0, 0.66, 0, 475, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.413, 0.0217, 0, 0.66, 0.1429, 773, 1, 0, 0, 0, 0, 1, 0 ], [ 8, 0, 0.4565, 0.0217, 0, 0.6...
[ "a = 2", "n = 3", "print(\" 2 % 3 in pymite:\", (a % n), \" and in cpython:\", 2)", "print(\" (-2) % 3 in pymite:\", ((-a) % n), \" and in cpython:\", 1)", "print(\" 2 % (-3) in pymite:\", (a % (-n)), \" and in cpython:\", -1)", "print(\"(-2) % (-3) in pymite:\", ((-a) % (-n)), \" and in cpython:...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.6296, 0.037, 0, 0.66, 0, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 1, 0, 0.6667, 0.037, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.7037, 0.037, 0, 0.66...
[ "import string", "from sys import gc", "from t347b import *", "print(bar1())", "print(bar2())", "gc()", "print('did gc')", "print(bar1())", "print(bar2())" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.1895, 0.0105, 0, 0.66, 0, 728, 3, 1, 0, 0, 528, 10, 1 ], [ 14, 0, 0.2, 0.0105, 0, 0.66, 0.0769, 341, 3, 1, 0, 0, 528, 10, 1 ], [ 14, 0, 0.2105, 0.0105, 0, ...
[ "b0 = bytearray(\"test\")", "b1 = bytearray(4)", "b2 = bytearray([2,5,6,2])", "b3 = bytearray((1,2,8,1))", "b4 = bytearray(b0)", "b5 = bytearray(['2',5,'6',2])", "b6 = bytearray(('1','2',8,1))", "b1[0] = 't'", "b1[1] = 'e'", "b1[2] = 's'", "b1[3] = 't'", "b0[False] = 0x34", "b0[True] = 0x32"...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.2609, 0.0145, 0, 0.66, 0, 827, 0, 2, 0, 0, 827, 0, 0 ], [ 4, 0, 0.4203, 0.2174, 0, 0.66, 0.5, 0, 1, 0, 0, 0, 0, 0, 12 ], [ 14, 1, 0.3333, 0.0145, 1, 0.75,...
[ "import dict, list", "if 1:\n d = {}\n d[0] = \"zero\"\n d[\"one\"] = 1\n print(d)\n print(dict.keys(d))\n print(dict.values(d))", " d = {}", " d[0] = \"zero\"", " d[\"one\"] = 1", " print(d)", " print(dict.keys(d))", " print(dict.values(d))", " dict.clear(d)",...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.5625, 0.0312, 0, 0.66, 0, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 14, 0, 0.7969, 0.25, 0, 0.66, 0.5, 553, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.9688, 0.0312, 0, 0.66,...
[ "import string", "s = \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234567890123456789\" \\\n \"0123456789012345678901234...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.5588, 0.0882, 0, 0.66, 0, 574, 0, 1, 0, 0, 0, 0, 1 ], [ 8, 1, 0.5588, 0.0294, 1, 0.18, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 1, 0.5882, 0.0294, 1, 0.18, ...
[ "def divzero(n):\n print(\"In divzero\")\n a = n/0", " print(\"In divzero\")", " a = n/0", "def foo():\n divzero(42)", " divzero(42)", "def bar():\n foo()", " foo()", "def baz():\n bar()", " bar()", "if ismain():\n print(\"calling baz()\")\n print(\"Expecting a ...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.7083, 0.0417, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 2, 0, 0.8542, 0.0833, 0, 0.66, 0.3333, 728, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 1, 0.875, 0.0417, 1, 0.67,...
[ "print(\"Generator with wrong num args, Expect TypeError\")", "def gen(o):\n yield o", " yield o", "f = gen()", "print(f.next())" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.76, 0.04, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.92, 0.04, 0, 0.66, 2, 509, 0, 1, 0, 0, 509, 0, 0 ] ]
[ "from sys import maxint", "from sys import *" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.825, 0.025, 0, 0.66, 0, 200, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.9, 0.025, 0, 0.66, 0.5, 730, 3, 1, 0, 0, 147, 10, 1 ], [ 8, 0, 0.925, 0.025, 0, 0.66, ...
[ "img = '\\nc\\x00\\x00\\x03\\x00\\x04\\x04\\x03\\x03\\x00sys\\x03\\x04\\x00putb\\x03\\x01\\x00n\\x03\\x00\\x00\\x04\\x05\\x01\\xff\\xff\\xff\\xff\\x00\\x014\\x00\\x00\\x00\\x01*\\x00\\x00\\x00\\x012\\x00\\x00\\x00d\\x00\\x00d\\x01\\x00k\\x00\\x00Z\\x00\\x00e\\x00\\x00i\\x01\\x00d\\x02\\x00\\x83\\x01\\x00Fd\\x03\\x0...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.3529, 0.0196, 0, 0.66, 0, 826, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.3725, 0.0196, 0, 0.66, 0.05, 745, 4, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3922, 0.0196, 0, 0.6...
[ "i = 4", "s1 = \"test %d\" % i", "s2 = \"test %d\" % (i,)", "i = 205", "s1 = \"test t%03d\" % i", "s2 = \"test t%03d\" % (i,)", "print(s1)", "f = -3.14", "s1 = \"test %f this\" % f", "s2 = \"test %f this\" % (f,)", "f = -3.14", "s1 = \"test %1.2f\" % f", "s2 = \"test %1.2f\" % (f,)", "s = ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.4524, 0.0238, 0, 0.66, 0, 553, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.4762, 0.0238, 0, 0.66, 0.2, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.6429, 0.0238, 0, 0.66,...
[ "s = \"farley\" * 3", "print(s)", "t = (2,5,6) * 3", "print(t)", "r = range(3) * 3", "print([[3,]*3, \"three\"*3, ('e',)*3]*3)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.72, 0.04, 0, 0.66, 0, 870, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.76, 0.04, 0, 0.66, 0.25, 282, 9, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.8, 0.04, 0, 0.66, 0.5, ...
[ "dx = 42", "f1 = lambda x: x - dx", "print(map(f1, range(5)))", "f2 = lambda x: x + dx", "print(map(f2, range(5)))" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.5111, 0.1556, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.8, 0.2444, 0, 0.66, 0.3333, 255, 0, 0, 0, 0, 0, 0, 0 ], [ 8, 1, 0.8, 0.2, 1, 0.12, 0, ...
[ "\"\"\"__NATIVE__\n/*\n * This is a regression test for issue #28.\n * Having this doc-level native block should not affect\n * the index of the native func below.\n */\n\"\"\"", "def push42():\n \"\"\"__NATIVE__\n pPmObj_t pint = C_NULL;\n PmReturn_t retval;\n\n retval = int_new((int32_t)42, &pint);\...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.85, 0.05, 0, 0.66, 0, 865, 0, 1, 0, 0, 865, 0, 0 ], [ 8, 0, 0.95, 0.05, 0, 0.66, 0.5, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 1, 0.05, 0, 0.66, 1, 535...
[ "from t350b import *", "print(\"Expect NameError\")", "print(_foo)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.9048, 0.0476, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ] ]
[ "import sys" ]
# This file is Copyright 2007 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, #...
[ [ 3, 0, 0.8824, 0.2941, 0, 0.66, 0, 928, 0, 2, 0, 0, 186, 0, 0 ], [ 2, 1, 0.8529, 0.1176, 1, 0.27, 0, 555, 0, 4, 0, 0, 0, 0, 0 ], [ 2, 1, 0.9706, 0.1176, 1, 0.27, ...
[ "class digital_io(object):\n def __init__(self, port, pin, isInput):\n pass\n def get(self,):\n return True", " def __init__(self, port, pin, isInput):\n pass", " def get(self,):\n return True", " return True" ]
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[]
[]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7917, 0.0417, 0, 0.66, 0, 190, 4, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.9167, 0.0417, 0, 0.66, 1, 190, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.9583, 0.0417, 0, 0.66, ...
[ "x = 2 ** 8", "x = 4", "x = x ** x" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.5862, 0.0345, 0, 0.66, 0, 430, 0, 1, 0, 0, 430, 0, 0 ], [ 14, 0, 0.6897, 0.0345, 0, 0.66, 0.5, 810, 0, 0, 0, 0, 0, 5, 0 ], [ 6, 0, 0.7586, 0.1034, 0, 0.66...
[ "import list", "l = []", "for i in xrange(3):\n print(i)\n list.append(l, i)", " print(i)", " list.append(l, i)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.3273, 0.0182, 0, 0.66, 0, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 0.3455, 0.0182, 0, 0.66, 0.1111, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 0.3636, 0.0182, 0, 0.66...
[ "print(\"True == \", True)", "print(\"False == \", False)", "print(\"not True == \", not True)", "print(\"not False == \", not False)", "d = {}", "d[True] = \"t\"", "d[False] = \"f\"", "d = {}", "d[0] = \"f\"", "d[1] = \"t\"" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.4872, 0.0256, 0, 0.66, 0, 888, 0, 0, 0, 0, 0, 5, 0 ], [ 8, 0, 0.5385, 0.0256, 0, 0.66, 0.2222, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.5897, 0.0256, 0, 0....
[ "l1 = [1, 2, 3]", "print(l1)", "l2 = [1, 2, 3, 4.0]", "print(l2)", "l3 = [1.0, 2.0, 3.0]", "print(l3)", "l4 = [1.1, 2.2, 3.3]", "print(l4)", "l5 = [1.1, 2.2, 3.3, 4.4]", "print(l5)" ]
# This file is Copyright 2011 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.725, 0.025, 0, 0.66, 10, 528, 0, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.75, 0.025, 0, 0.66, 11, 300, 0, 0, 0, 0, 0, 0, 0 ] ]
[ "def foo(): pass", "def bar(): pass" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.3684, 0.0132, 0, 0.66, 0.2308, 411, 3, 1, 0, 0, 171, 10, 1 ], [ 14, 0, 0.4079, 0.0132, 0, 0.66, 0.3846, 411, 3, 1, 0, 0, 171, 10, 1 ], [ 14, 0, 0.4474, 0.0132, ...
[ "c = ord(\"t\")", "c = ord(\"\\xff\")", "c = ord(\"\\x00\")", "n = chr(0)", "n = chr(255)", "n = chr(116)", "i = 32", "while i >= 0:\n assert ord(chr(i)) == i\n i -= 1", "n = 255", "m = abs(n)", "n = -42", "m = abs(n)", "s = [2, 5, 6]", "s = (2, 5, 6)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.15, 0.0083, 0, 0.66, 0, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 0.1917, 0.0083, 0, 0.66, 0.2667, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 0.2333, 0.0083, 0, 0.66, ...
[ "print(\"0.0 + 3.0 == \", 0.0 + 3.0)", "print(\"0.0 - 3.0 == \", 0.0 - 3.0)", "print(\"0.0 * 3.0 == \", 0.0 * 3.0)", "print(\"0.0 / 3.0 == \", 0.0 / 3.0)", "print(\"0.0 % 3.0 == \", 0.0 % 3.0)", "print(\"3.0 ** 3.0 == \", 3.0 ** 3.0)", "print(\"0.0 and 3.0 == \", 0.0 and 3.0)", "print(\"0.0 or 3.0 == ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.413, 0.0217, 0, 0.66, 0, 15, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.5652, 0.0217, 0, 0.66, 2, 810, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.7174, 0.0217, 0, 0.66, ...
[ "t = (2,5,6)", "l = [2,5,6]", "s = \"256\"", "d = {2:2, 5:\"5\", 6:None}" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.371, 0.0161, 0, 0.66, 0, 553, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.4516, 0.0161, 0, 0.66, 0.5, 15, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.5323, 0.0161, 0, 0.66, ...
[ "s = \"test\"", "t = (4, 2)", "l = [2, 5, 6]", "d = {0:0, 1:'t', \"2\":2}", "a,b,c = (1,2,3)", "c,b,a = [2,5,6]", "a,b,c = \"256\"" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[]
[]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.75, 0.125, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.875, 0.0417, 0, 0.66, 0.3333, 756, 0, 0, 0, 0, 0, 0, 1 ], [ 8, 0, 0.9167, 0.0417, 0, 0.66, ...
[ "\"\"\"NOT__NATIVE__\n/* Inserted this so there is a module-level __doc__ string in the code object */\n\"\"\"", "b = \"__doc__\" in globals()", "print(\"__doc__ in globals == \", b)", "if b:\n print(\"len(__doc__) == \", len(globals()[\"__doc__\"]))", " print(\"len(__doc__) == \", len(globals()[\"__d...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.2237, 0.0132, 0, 0.66, 0, 827, 0, 1, 0, 0, 827, 0, 0 ], [ 14, 0, 0.3026, 0.0132, 0, 0.66, 0.0625, 810, 3, 1, 0, 0, 816, 10, 1 ], [ 8, 0, 0.3158, 0.0132, 0, ...
[ "import dict", "l = range(5)", "print(\"del l[3]\")", "print(l)", "d = {}", "for n in range(5):\n d[n] = n", " d[n] = n", "print(\"del d[3]\")", "print(\"d=\", d)", "print(\"keys(locals)=\", dict.keys(locals()))", "def delglob():\n global l\n print(\"delglob's l=\",l)\n del l", ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.8182, 0.0455, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.9091, 0.0455, 0, 0.66, 1, 686, 3, 0, 0, 0, 283, 10, 1 ] ]
[ "import sys", "h = sys.heap()" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.5897, 0.0256, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 0.641, 0.0256, 0, 0.66, 0.0833, 535, 3, 2, 0, 0, 0, 0, 2 ], [ 14, 0, 0.6923, 0.0256, 0, 0....
[ "import sys", "print(\"Heap =\", sys.heap())", "start = ord('a')", "r = map(chr, range(start, start+36))", "t = map(type, r)", "print(\"r = \", r)", "print(\"t = \", t)", "print(\"Heap =\", sys.heap())", "start = ord('A')", "r = map(chr, range(start, start+36))", "print(\"r = \", r)", "print(\...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.84, 0.04, 0, 0.66, 0, 430, 0, 1, 0, 0, 430, 0, 0 ], [ 14, 0, 0.88, 0.04, 0, 0.66, 0.5, 945, 1, 0, 0, 0, 0, 1, 0 ], [ 1, 0, 0.96, 0.04, 0, 0.66, 1, ...
[ "import list", "list.zero = 0", "import list" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 1, 0.0588, 0, 0.66, 0, 187, 1, 0, 0, 0, 0, 3, 0 ] ]
[ "_foo = \"foo\"" ]
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.6207, 0.0345, 0, 0.66, 0, 745, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.6552, 0.0345, 0, 0.66, 0.3333, 448, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.7586, 0.0345, 0, 0...
[ "s1 = \"test\"", "s2 = \"this\"", "s3 = \"\"", "print(\"String concatenation \" + s1 + \" passes\")" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 3, 0, 0.6571, 0.2, 0, 0.66, 0, 429, 0, 1, 0, 0, 0, 0, 0 ], [ 2, 1, 0.6714, 0.1714, 1, 0.91, 0, 555, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 2, 0.6714, 0.1143, 2, 0.36, 0,...
[ "class A():\n def __init__(self,):\n \"\"\"__NATIVE__\n NATIVE_SET_TOS(PM_NONE);\n return PM_RET_OK;\n \"\"\"\n pass", " def __init__(self,):\n \"\"\"__NATIVE__\n NATIVE_SET_TOS(PM_NONE);\n return PM_RET_OK;\n \"\"\"\n pass", " \...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.383, 0.0213, 0, 0.66, 0, 175, 3, 2, 0, 0, 526, 10, 2 ], [ 8, 0, 0.4255, 0.0213, 0, 0.66, 0.2222, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.4894, 0.0213, 0, ...
[ "e = filter(lambda x: x%2 == 0, range(5))", "print(\"filter() test 1 passes.\")", "e = filter(lambda x: x%2 == 2, range(5))", "print(\"filter() test 2 passes.\")", "e = filter(lambda x: True, range(0))", "print(\"filter() test 3 passes.\")", "e = filter(lambda x: True, [])", "print(\"filter() test 4 p...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.2812, 0.0156, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 3, 0, 0.3438, 0.0469, 0, 0.66, 0.0769, 854, 0, 1, 0, 0, 186, 0, 0 ], [ 2, 1, 0.3516, 0.0312, 1, ...
[ "import sys", "class Bar(object):\n def baz(self, ):\n return \"baz\"", " def baz(self, ):\n return \"baz\"", " return \"baz\"", "class Foo(Bar):\n def faz(self, ):\n return \"faz\"", " def faz(self, ):\n return \"faz\"", " return \"faz\"", "foo = ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.3286, 0.0143, 0, 0.66, 0, 475, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.3429, 0.0143, 0, 0.66, 0.0909, 756, 5, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.3571, 0.0143, 0, 0...
[ "a = [1,2,3,4]", "b = (2*x for x in a)", "c = [2*x for x in a]", "n = 0", "for i in b:\n print(i,)\n assert i == c[n]\n n += 1", " print(i,)", "def fib():\n a, b = 0, 1\n while True:\n yield a\n a, b = b, a+b", " a, b = 0, 1", " while True:\n yield a\n ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.5625, 0.0312, 0, 0.66, 0, 556, 4, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.5938, 0.0312, 0, 0.66, 0.125, 921, 4, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.625, 0.0312, 0, 0.6...
[ "kn1 = 1 - 2", "k0 = kn1 + 1", "k1 = k0 + 1", "id1 = id(-1)", "id2 = id(kn1)", "id1 = id(0)", "id2 = id(k0)", "id1 = id(1)", "id2 = id(k1)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.4386, 0.0175, 0, 0.66, 0, 553, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.4561, 0.0175, 0, 0.66, 0.0909, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.5263, 0.0175, 0, 0....
[ "s = \"farley\" * 30", "print(s)", "mul = 0", "mul = -42", "t = (2,5,6) * 30", "print(t)", "mul = 0", "mul = -42", "r = range(3) * 30", "mul = 0", "mul = -42", "print([[3,]*30, \"three\"*30, ('e',)*30]*30)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.7692, 0.0385, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.8077, 0.0385, 0, 0.66, 0.25, 475, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.8462, 0.0385, 0, 0.66...
[ "print(\"Thread B\")", "a = 666", "b = -2", "for i in range(10):\n a += i\n b -= i", "print(a*b)" ]
# # PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers. # Copyright 2010 Dean Hall. All rights reserved. # PyMite is offered through one of two licenses: commercial or open-source. # See the LICENSE file at the root of this package for licensing details. # # # System Test 281 # Fix float co...
[ [ 14, 0, 0.7647, 0.0588, 0, 0.66, 0, 475, 1, 0, 0, 0, 0, 2, 0 ], [ 14, 0, 0.8235, 0.0588, 0, 0.66, 0.5, 756, 1, 0, 0, 0, 0, 2, 0 ], [ 8, 0, 0.8824, 0.0588, 0, 0.66,...
[ "a = 3.4e-15", "b = 3.5e-15", "print(\"a == b ?\", a == b)" ]
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.4022, 0.0435, 0, 0.66, 0, 528, 0, 0, 1, 0, 0, 0, 0 ], [ 13, 1, 0.413, 0.0217, 1, 0.88, 0, 0, 1, 0, 0, 0, 0, 3, 0 ], [ 2, 0, 0.4674, 0.0435, 0, 0.66, 0...
[ "def foo():\n return \"foo\"", " return \"foo\"", "def foo1(a=42):\n return a+1", " return a+1", "def foo2(a,b=42):\n return a+b", " return a+b", "print(foo())", "print(foo1())", "print(foo1(1))", "print(foo2(1))", "print(foo2(1,2))", "print(\"Expect TypeError:\")", "map(ma...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.5, 0.0294, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 2, 0, 0.6176, 0.0882, 0, 0.66, 0.1667, 557, 0, 1, 0, 0, 0, 0, 0 ], [ 6, 1, 0.6324, 0.0588, 1, 0.31,...
[ "from sys import gc", "def iter(s):\n for i in s:\n yield i", " for i in s:\n yield i", " yield i", "ch = iter(\"abcd\")", "def i():\n print(ch.next())\n gc()", " print(ch.next())", " gc()", "i()", "i()", "i()" ]
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 2, 0, 0.5847, 0.5085, 0, 0.66, 0, 243, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 1, 0.5847, 0.4746, 1, 0.9, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.8898, 0.0339, 0, 0.66, 0....
[ "def __gc_test(val):\n \"\"\"__NATIVE__\n pPmObj_t pval;\n int32_t nval;\n PmReturn_t retval = PM_RET_OK;\n\n if (NATIVE_GET_NUM_ARGS() != 1)\n {", " \"\"\"__NATIVE__\n pPmObj_t pval;\n int32_t nval;\n PmReturn_t retval = PM_RET_OK;\n\n if (NATIVE_GET_NUM_ARGS() != 1)\n {\n ...
# This file is Copyright 2003 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.375, 0.0208, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.4167, 0.0208, 0, 0.66, 0.125, 573, 3, 0, 0, 0, 654, 10, 1 ], [ 8, 0, 0.4583, 0.0208, 0, ...
[ "import sys", "t0 = sys.time()", "print(\"t0 = \", t0)", "print(\"killing time...\")", "i=0", "while i < 10000:\n j=0\n while j < 100:\n j += 1\n if i%100 == 0:\n print(i / 100, \" \",)\n i += 1", " j=0", " while j < 100:\n j += 1", " if i%100 == 0:\n ...
# This file is Copyright 2011 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 1, 0, 0.9474, 0.0526, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 1, 0.0526, 0, 0.66, 1, 92, 3, 0, 0, 0, 0, 0, 1 ] ]
[ "import sys", "sys.gc()" ]
#!/usr/bin/env python # This file is Copyright 2001 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. """ PyMite Image Creator ==================== Converts Python source files to a PyMite code image library. Performs ...
[ [ 8, 0, 0.0193, 0.0229, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0484, 0.0166, 0, 0.66, 0.0244, 207, 1, 0, 0, 0, 0, 3, 0 ], [ 1, 0, 0.0593, 0.001, 0, 0.66, ...
[ "\"\"\"\nPyMite Image Creator\n====================\n\nConverts Python source files to a PyMite code image library.\nPerforms code filtering to ensure it will run in PyMite.\nFormats the image as a raw binary file or a C file\ncontaining a byte array.", "__usage__ = \"\"\"USAGE:\n pmImgCreator.py -f pmfeatures...
#!/usr/bin/env python # This file is Copyright 2009 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. """Creates a release package for PyMite Makes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.g...
[ [ 8, 0, 0.1786, 0.0893, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.3571, 0.0179, 0, 0.66, 0.0833, 688, 0, 5, 0, 0, 688, 0, 0 ], [ 14, 0, 0.4107, 0.0179, 0, 0.6...
[ "\"\"\"Creates a release package for PyMite\n\nMakes fresh export (no .svn folders), builds the docs, makes pymite-RR.tar.gz\nand creates release tag in the svn repository\n\"\"\"", "import os, string, subprocess, sys, tempfile", "REPOS = \"https://python-on-a-chip.googlecode.com/svn/\"", "RELEASE_NUM = sys.a...
#!/usr/bin/env python # Copyright 2009 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. ## @file # @copydoc pmReplaceCopyright ## @package pmReplaceCopyright # @brief This program naively replaces the copyright head...
[ [ 1, 0, 0.2571, 0.0143, 0, 0.66, 0, 688, 0, 2, 0, 0, 688, 0, 0 ], [ 14, 0, 0.3786, 0.1714, 0, 0.66, 0.2, 212, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.5643, 0.1714, 0, 0.6...
[ "import os, sys", "PoaC_COPYRIGHT = \"\"\"# This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.\n#\n# This file is part of the Python-on-a-Chip program.\n# Python-on-a-Chip is free software: you can redistribute it and/or modify\n# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.\n#\n...
#!/usr/bin/env python # This file is Copyright 2009 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. """ PyMite Heap Dump ================ Parses a heap dump into human-readable format. The heap dump file is created ...
[ [ 8, 0, 0.032, 0.0436, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0681, 0.0014, 0, 0.66, 0.0833, 688, 0, 6, 0, 0, 688, 0, 0 ], [ 7, 0, 0.0729, 0.0054, 0, 0.66,...
[ "\"\"\"\nPyMite Heap Dump\n================\n\nParses a heap dump into human-readable format.\n\nThe heap dump file is created by inserting a calls to heap_dump()\ninside heap_gcRun(). Using two calls, a before and after, is ideal.", "import os, struct, sys, types, UserDict, collections", "try:\n import cSt...
#!/usr/bin/env python # This file is Copyright 2009 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. """ PyMite Object Descriptor Decoder ================================ Decodes an object descriptor value into its bi...
[ [ 8, 0, 0.104, 0.0594, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2376, 0.0099, 0, 0.66, 0.125, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.2772, 0.0297, 0, 0.66,...
[ "\"\"\"\nPyMite Object Descriptor Decoder\n================================\n\nDecodes an object descriptor value into its bit fields.\n\"\"\"", "import sys", "__usage__ = \"\"\"USAGE:\n ./pmOdDecoder.py odvalue\n\"\"\"", "TYPES = (\n 'OBJ_TYPE_NON',\n 'OBJ_TYPE_INT',\n 'OBJ_TYPE_FLT',\n 'OBJ_T...
#!/usr/bin/env python # This file is Copyright 2001 Dean Hall. # This file is part of the Python-on-a-Chip tools. # This software is licensed under the MIT License. # See the LICENSE file for details. """ Python Byte Code utility functions. count(fn) - count the number of times each byte code appears in ...
[ [ 8, 0, 0.1061, 0.0606, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2626, 0.0101, 0, 0.66, 0.1667, 279, 0, 2, 0, 0, 279, 0, 0 ], [ 14, 0, 0.303, 0.0101, 0, 0.66...
[ "\"\"\"\nPython Byte Code utility functions.\n\ncount(fn) - count the number of times each byte code\n appears in a code object.\n\"\"\"", "import dis, types", "MAX_BCODE = 150", "def count(fn):\n \"\"\"\n Compile the python source file named fn.\n Count all the bytecodes in the file.\n ...
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, #...
[ [ 1, 0, 0.9286, 0.0714, 0, 0.66, 0, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 1, 0.0714, 0, 0.66, 1, 327, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "import ipm", "ipm.ipm(globals())" ]
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.0141, 0.0109, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.0558, 0.0699, 0, 0.66, 0.1, 238, 0, 3, 0, 0, 186, 0, 0 ], [ 2, 1, 0.0353, 0.0263, 1, 0.89, ...
[ "\"\"\"__NATIVE__\n#include \"mbed.h\"\n#include \"TextLCD.h\"\n\nstatic DigitalOut led1(LED1);\nstatic DigitalOut led2(LED2);\nstatic DigitalOut led3(LED3);\nstatic DigitalOut led4(LED4);", "class AnalogIn(object):\n\n def __init__(self, n):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmObj_t...
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, #...
[ [ 1, 0, 0.9474, 0.0526, 0, 0.66, 0, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 1, 0.0526, 0, 0.66, 1, 327, 3, 0, 0, 0, 0, 0, 1 ] ]
[ "import ipm", "ipm.ipm()" ]
Import("vars") vars.Add("IPM", "Add the interactive library to the standard lib", True) CFLAGS = "-Os -Wall -gstabs -Wstrict-prototypes -Werror" if "DEBUG" in vars.args.keys(): CFLAGS = "-g -ggdb -D__DEBUG__=1 " + CFLAGS SOURCES = ["main.c", "plat.c"] PY_SOURCES = ["main.py"] PM_LIB_ROOT = ["pmvm_%s" % vars.args[...
[ [ 8, 0, 0.0476, 0.0476, 0, 0.66, 0, 248, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.1429, 0.0476, 0, 0.66, 0.1, 241, 3, 3, 0, 0, 0, 0, 1 ], [ 14, 0, 0.2381, 0.0476, 0, 0.66, ...
[ "Import(\"vars\")", "vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)", "CFLAGS = \"-Os -Wall -gstabs -Wstrict-prototypes -Werror\"", "if \"DEBUG\" in vars.args.keys():\n CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS", " CFLAGS = \"-g -ggdb -D__DEBUG__=1 \" + CFLAGS", "SO...
# This file is Copyright 2009 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
[ [ 8, 0, 0.1939, 0.0102, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.2143, 0.0102, 0, 0.66, 0.1667, 718, 0, 1, 0, 0, 718, 0, 0 ], [ 14, 0, 0.2449, 0.0102, 0, 0...
[ "print(\"Hello world.\")", "import avr", "teensyVersion = 1", "morse = {\n# 'A' : '.-',\n# 'B' : '-...',\n# 'C' : '-.-.',\n 'D' : '-..',\n 'E' : '.',\n# 'F' : '..-.',\n# 'G' : '--.',", "def loop():\n for i in range(1,6):\n printMorse(\"SOS\")\n avr.delay(1500)\n prin...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# # PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers. # Copyright 2002 Dean Hall. All rights reserved. # PyMite is offered through one of two licenses: commercial or open-source. # See the LICENSE file at the root of this package for licensing details. # import ipm ipm.ipm() # :mode=c:
[ [ 1, 0, 0.7273, 0.0909, 0, 0.66, 0, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 0.8182, 0.0909, 0, 0.66, 1, 327, 3, 0, 0, 0, 0, 0, 1 ] ]
[ "import ipm", "ipm.ipm()" ]
#!/usr/bin/env python import urllib, zipfile, StringIO from os import path, mkdir extra_headers = ['stm32f10x.h','core_cm3.h','cortexm3_macro.h','system_stm32f10x.h'] extra_sources = ['core_cm3.c','cortexm3_macro.s','system_stm32f10x.c'] startup_files = ['startup_stm32f10x_hd.s'] #stm32liburl = 'http://www.st.com/st...
[ [ 1, 0, 0.0769, 0.0256, 0, 0.66, 0, 614, 0, 3, 0, 0, 614, 0, 0 ], [ 1, 0, 0.1026, 0.0256, 0, 0.66, 0.0909, 688, 0, 2, 0, 0, 688, 0, 0 ], [ 14, 0, 0.1538, 0.0256, 0, ...
[ "import urllib, zipfile, StringIO", "from os import path, mkdir", "extra_headers = ['stm32f10x.h','core_cm3.h','cortexm3_macro.h','system_stm32f10x.h']", "extra_sources = ['core_cm3.c','cortexm3_macro.s','system_stm32f10x.c']", "startup_files = ['startup_stm32f10x_hd.s']", "stm32liburl = \"http://www.st.c...
import os import glob TCHAIN = "arm-none-eabi" Import("vars") vars.Add("PM_UART_BAUD", "Baud rate of the ipm serial connection.", "19200") vars.Add("IPM", "Add the interactive library to the standard lib", True) vars.Add("MCU", "Type of ARM device; the arg to -mcpu.", "cortex-m3") vars.Add("NM", "", "arm-eabi-nm") v...
[ [ 1, 0, 0.0154, 0.0154, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0308, 0.0154, 0, 0.66, 0.0435, 958, 0, 1, 0, 0, 958, 0, 0 ], [ 14, 0, 0.0615, 0.0154, 0, ...
[ "import os", "import glob", "TCHAIN = \"arm-none-eabi\"", "Import(\"vars\")", "vars.Add(\"PM_UART_BAUD\", \"Baud rate of the ipm serial connection.\", \"19200\")", "vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)", "vars.Add(\"MCU\", \"Type of ARM device; the arg to -mcpu.\"...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# # PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers. # Copyright 2002 Dean Hall. All rights reserved. # PyMite is offered through one of two licenses: commercial or open-source. # See the LICENSE file at the root of this package for licensing details. # import ipm ipm.ipm()
[ [ 1, 0, 0.8889, 0.1111, 0, 0.66, 0, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 1, 0.1111, 0, 0.66, 1, 327, 3, 0, 0, 0, 0, 0, 1 ] ]
[ "import ipm", "ipm.ipm()" ]
#!/usr/bin/python # This file was written by Andrew Pullin # This file obtained from: http://bmi.berkeley.edu/~pullin/red-bsl.py # No copyright or licensing is claimed # Permission to use this file was granted via correspondence import serial from struct import pack,unpack import os import sys import time from optpa...
[ [ 1, 0, 0.0316, 0.0035, 0, 0.66, 0, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 1, 0, 0.0351, 0.0035, 0, 0.66, 0.0161, 399, 0, 2, 0, 0, 399, 0, 0 ], [ 1, 0, 0.0386, 0.0035, 0, ...
[ "import serial", "from struct import pack,unpack", "import os", "import sys", "import time", "from optparse import OptionParser", "parser = OptionParser()", "parser.add_option(\"-f\", \"--file\", dest=\"filename\",\n help=\"binary file to program\", metavar=\"FILE\")", "parser.add_o...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 8, 0, 0.0384, 0.0186, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.1105, 0.1163, 0, 0.66, 0.0909, 9, 0, 2, 0, 0, 0, 0, 0 ], [ 8, 1, 0.1105, 0.1116, 1, 0.76, ...
[ "\"\"\"__NATIVE__\n#include \"mc1322x.h\"\n#include \"board.h\"\n\n#ifndef HAVE_BYTEARRAY\n#error HAVE_BYTEARRAY must be defined for the Econotag packet implementation\n#endif\n\"\"\"", "def gpio_func_sel(gpio, mode):\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n pPmObj_t pgpio, pmode;\n int32...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": False,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# This file is Copyright 2010 Oscar Lindberg. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be usefu...
[ [ 1, 0, 0.1548, 0.0119, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1667, 0.0119, 0, 0.66, 0.0769, 430, 0, 1, 0, 0, 430, 0, 0 ], [ 1, 0, 0.1786, 0.0119, 0, ...
[ "import sys", "import list", "from ma import *", "print(\"MoPync - bringing the Guido goodness to the world of MoSync\")", "LOGO_HANDLE = 1", "logo_width, logo_height = maGetImageSize(LOGO_HANDLE)", "screen_width, screen_height = maGetScrSize()", "background_color = 0x330055", "rectangles = []", "...
# This file contains wrappers that has been automatically # generated from the maapi.h. Some of these has been moved # to ma.py, sometimes they have changed into more a more # Pythonic format. # When some function or constant is missing from ma.h, # it might be here. """__NATIVE__ #include <ma.h> """ TRANS_NONE = 0...
[ [ 8, 0, 0.003, 0.0009, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0041, 0.0003, 0, 0.66, 0.0034, 276, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0047, 0.0003, 0, 0.66,...
[ "\"\"\"__NATIVE__\n#include <ma.h>\n\"\"\"", "TRANS_NONE = 0", "TRANS_ROT90 = 5", "TRANS_ROT180 = 3", "TRANS_ROT270 = 6", "TRANS_MIRROR = 2", "TRANS_MIRROR_ROT90 = 7", "TRANS_MIRROR_ROT180 = 1", "TRANS_MIRROR_ROT270 = 4", "HANDLE_SCREEN = 0", "HANDLE_LOCAL = 0", "RES_OUT_OF_MEMORY = 1", "RES...
# This file contains wrappers for the basic # functions in maapi. # If a function or constant is missing, look in ma_gen.py, it # might be there. """__NATIVE__ #include <ma.h> #define POP_TMPROOT_AND_RETURN_IF_ERROR(retval, objid) \ do \ { \ if ((retval) != PM_RET_OK) \ { \ heap_g...
[ [ 8, 0, 0.0091, 0.0097, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0149, 0.0006, 0, 0.66, 0.0106, 276, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.0156, 0.0006, 0, 0.66...
[ "\"\"\"__NATIVE__\n#include <ma.h>\n\n#define POP_TMPROOT_AND_RETURN_IF_ERROR(retval, objid) \\\n do \\\n { \\\n if ((retval) != PM_RET_OK) \\\n { \\", "TRANS_NONE = 0", "TRANS_ROT90 = 5", "TRANS_ROT180 = 3", "TRANS_ROT270 = 6", "TRANS_MIRROR = 2", "TRANS_MIRROR_ROT90 = 7", "TRANS_...
# This file is Copyright 2010 Dean Hall. # # This file is part of the Python-on-a-Chip program. # Python-on-a-Chip is free software: you can redistribute it and/or modify # it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1. # # Python-on-a-Chip is distributed in the hope that it will be useful, # ...
[ [ 14, 0, 0.7097, 0.6129, 0, 0.66, 0, 965, 0, 0, 0, 0, 0, 6, 0 ] ]
[ "PM_FEATURES = {\n \"HAVE_PRINT\": True,\n \"HAVE_GC\": True,\n \"HAVE_FLOAT\": True,\n \"HAVE_DEL\": True,\n \"HAVE_IMPORTS\": True,\n \"HAVE_DEFAULTARGS\": True,\n \"HAVE_REPLICATION\": True," ]
# # PyMite - A flyweight Python interpreter for 8-bit and larger microcontrollers. # Copyright 2002 Dean Hall. All rights reserved. # PyMite is offered through one of two licenses: commercial or open-source. # See the LICENSE file at the root of this package for licensing details. # # # Runs the interactive interpret...
[ [ 8, 0, 0.7059, 0.0588, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.8235, 0.0588, 0, 0.66, 0.3333, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 0.8824, 0.0588, 0, 0....
[ "print(\"Hello\")", "import ipm", "ipm.ipm(globals())", "print(\"Good-bye\")" ]