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.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 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.7031, 0.625, 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 2006 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.1753, 0.0309, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.4021, 0.3814, 0, 0.66, 0.25, 885, 0, 0, 0, 0, 0, 0, 0 ], [ 8, 1, 0.4021, 0.3608, 1, 0.53, ...
[ "\"\"\"__NATIVE__\n#include \"Board.h\"\n\"\"\"", "def get_buttons():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n uint32_t val = 0;\n pPmObj_t pint;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 0)", " \"\"\"__NATIVE__\n PmReturn_t retval = P...
import os Import("vars") vars.Add("IPM", "Add the interactive library to the standard lib", True) vars.Add("MCU", "Type of ARM device; the arg to -mmcu.", "arm7tdmi") vars.Add("SUBMDL", "The sub-model of ARM device.", "AT91SAM7S64") vars.Add("NM", "", "arm-elf-nm") vars.Add("OBJCOPY", "", "arm-elf-objcopy") vars.Add(...
[ [ 1, 0, 0.0204, 0.0204, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 8, 0, 0.0612, 0.0204, 0, 0.66, 0.0435, 248, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.102, 0.0204, 0, 0.6...
[ "import os", "Import(\"vars\")", "vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)", "vars.Add(\"MCU\", \"Type of ARM device; the arg to -mmcu.\", \"arm7tdmi\")", "vars.Add(\"SUBMDL\", \"The sub-model of ARM device.\", \"AT91SAM7S64\")", "vars.Add(\"NM\", \"\", \"arm-elf-nm\")"...
# 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.7031, 0.625, 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 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.8667, 0.0667, 0, 0.66, 0, 327, 0, 1, 0, 0, 327, 0, 0 ], [ 8, 0, 1, 0.0667, 0, 0.66, 1, 327, 3, 0, 0, 0, 0, 0, 1 ] ]
[ "import ipm", "ipm.ipm()" ]
# This file is Copyright 2006 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.0732, 0.0135, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.1216, 0.0743, 0, 0.66, 0.1667, 212, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 1, 0.1216, 0.0698, 1, 0.55, ...
[ "\"\"\"__NATIVE__\n#include <stdio.h>\n#include <avr/io.h>\n#include <util/delay.h>\n#include \"libmmb103.h\"\n\"\"\"", "def adc_get(c):\n \"\"\"__NATIVE__\n /* The arg is the ADC channel to read */\n pPmObj_t pc = C_NULL;\n pPmObj_t pr = C_NULL;\n uint8_t chan;\n PmReturn_t retval;", " \"\...
# This file is Copyright 2006 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.1486, 0.0435, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 4, 0, 0.279, 0.1449, 0, 0.66, 0.25, 0, 1, 0, 0, 0, 0, 0, 11 ], [ 1, 1, 0.2174, 0.0072, 1, 0.29, ...
[ "\"\"\"__NATIVE__\n#include <stdio.h>\n#include <avr/io.h>\n#include <util/delay.h>\n#include \"libmmb103.h\"\n\"\"\"", "if False:\n import sys\n\n s = \"It's alive!\"\n print(s)\n\n import mmb\n mmb.lcd_print(\"PyMite on MMB103\")", " import sys", " s = \"It's alive!\"", " print(s)"...
import os Import("vars") vars.Add("IPM", "Add the interactive library to the standard lib", True) vars.Add("MCU", "Type of AVR device; the arg to -mmcu.", "atmega103") vars.Add("F_CPU", "Operating frequency of the AVR device.", "4000000UL") vars.Add("NM", "", "avr-nm") vars.Add("OBJCOPY", "", "avr-objcopy") vars.Add(...
[ [ 1, 0, 0.0213, 0.0213, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 8, 0, 0.0638, 0.0213, 0, 0.66, 0.0526, 248, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 0, 0.1064, 0.0213, 0, 0....
[ "import os", "Import(\"vars\")", "vars.Add(\"IPM\", \"Add the interactive library to the standard lib\", True)", "vars.Add(\"MCU\", \"Type of AVR device; the arg to -mmcu.\", \"atmega103\")", "vars.Add(\"F_CPU\", \"Operating frequency of the AVR device.\", \"4000000UL\")", "vars.Add(\"NM\", \"\", \"avr-nm...
# 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.3, ...
[ "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 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.5806, 0.0323, 0, 0.66, 0, 745, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.6129, 0.0323, 0, 0.66, 0.2, 448, 6, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.7419, 0.0323, 0, 0.66...
[ "s1 = \"test\"", "s2 = s1[:]", "t1 = (1,2,3)", "t2 = t1[:]", "l1 = [1,2,3]", "l2 = l1[:]" ]
# 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 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.98, 0, 555, 0, 4, 0, 0, 0, 0, 0 ], [ 2, 1, 0.9706, 0.1176, 1, 0.98, ...
[ "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, # ...
[ [ 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.95, 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 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.6029, 0.0588, 0, 0.66, 0, 331, 0, 2, 1, 0, 0, 0, 0 ], [ 13, 1, 0.6176, 0.0294, 1, 0.1, 0, 0, 4, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.75, 0.0588, 0, 0.66, 0.5...
[ "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, # ...
[ [ 2, 0, 0.5385, 0.1282, 0, 0.66, 0, 475, 0, 2, 1, 0, 0, 0, 0 ], [ 8, 1, 0.5385, 0.0769, 1, 0.87, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 13, 1, 0.5897, 0.0256, 1, 0.87, ...
[ "def a(a1, a2):\n \"\"\"\n Return the sum of a1 and a2.\n \"\"\"\n return a1 + a2", " \"\"\"\n Return the sum of a1 and a2.\n \"\"\"", " return a1 + a2", "def b(b1, b2):\n \"\"\"\n Return the difference between b1 and b2.\n \"\"\"\n return b1 - b2", " \"\"\"\n Retur...
# 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 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, # ...
[ [ 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, 0.5, 553, 1, 0, 0, 0, 0, 3, 0 ], [ 4, 0, 0.9773, 0.0909, 0, 0.66...
[ "import sys", "s = \"test\"", "if s[0] != 't':\n sys.exit(1)", " sys.exit(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, # ...
[ [ 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, # ...
[ [ 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.0...
[ "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 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, # ...
[ [ 1, 0, 0.9048, 0.0476, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ] ]
[ "import sys" ]
# 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, # ...
[ [ 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 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, # ...
[ [ 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 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.6667, 0.5, 0, 0.66, 0, 102, 0, 0, 0, 0, 0, 0, 0 ], [ 8, 1, 0.6667, 0.4333, 1, 0.53, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.9833, 0.0667, 0, 0.66, 1, ...
[ "def bar1():\n \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError */\n if (NATIVE_GET_NUM_ARGS() != 0)\n {\n PM_RAISE(retval, PM_RET_EX_TYPE);", " \"\"\"__NATIVE__\n PmReturn_t retval = PM_RET_OK;\n\n /* If wrong number of args, raise TypeError ...
# 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 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.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, # ...
[ [ 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.22, 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 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, # ...
[ [ 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.39, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 1, 0.5882, 0.0294, 1, 0.39, ...
[ "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, # ...
[ [ 14, 0, 1, 0.0588, 0, 0.66, 0, 187, 1, 0, 0, 0, 0, 3, 0 ] ]
[ "_foo = \"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, # ...
[ [ 2, 0, 0.8409, 0.0909, 0, 0.66, 0, 528, 0, 1, 1, 0, 0, 0, 0 ], [ 13, 1, 0.8636, 0.0455, 1, 0.94, 0, 0, 4, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.9545, 0.0455, 0, 0.66, ...
[ "def foo(n):\n return n * 1", " return n * 1", "print(\"Expecting a TypeError\")", "foo(1, 2)" ]
# 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.6061, 0.0303, 0, 0.66, 0, 355, 0, 0, 0, 0, 0, 6, 0 ], [ 6, 0, 0.6818, 0.0606, 0, 0.66, 0.3333, 826, 2, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.7576, 0.0303, 0, 0....
[ "d = {0:None, 1:\"one\", 2:\"two\"}", "for i in d:\n assert i in d", "k1,k2,k3 = d", "s = sum(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, # ...
[ [ 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.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, # ...
[ [ 8, 0, 0.5312, 0.0312, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 14, 0, 0.5938, 0.0312, 0, 0.66, 0.125, 475, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.625, 0.0312, 0, 0.66...
[ "print(\"hex(42) == %x\" % 42)", "a = 42", "s = \"%x\" % a", "print(s)", "S = \"%X\" % a", "print(S)", "print(\"Expect TypeError\")", "b = 3.14", "p = \"%x\" % b" ]
# 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, # ...
[ [ 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.19, 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)))" ]
# # 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, # ...
[ [ 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)" ]
# 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, # ...
[ [ 1, 0, 0.2088, 0.011, 0, 0.66, 0, 890, 0, 2, 0, 0, 890, 0, 0 ] ]
[ "import string, sys" ]
# 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", ...
# Anything that starts with a # is a comment! # Use lots of comments in your code to explain what you're doing. # Use the PIC-specific Python libraries import t114 as pic line_sensor_right = pic.digital_io(1, 8, True) right_wheel_stopped = 938 print "Running..." i = 0; while i < 10: i = i + 1 # Print ou...
[ [ 1, 0, 0.3125, 0.0625, 0, 0.66, 0, 423, 0, 1, 0, 0, 423, 0, 0 ], [ 14, 0, 0.4375, 0.0625, 0, 0.66, 0.2, 927, 3, 3, 0, 0, 928, 10, 1 ], [ 14, 0, 0.5, 0.0625, 0, 0.6...
[ "import t114 as pic", "line_sensor_right = pic.digital_io(1, 8, True)", "right_wheel_stopped = 938", "print(\"Running...\")", "i = 0;", "while i < 10:\n i = i + 1\n # Print out line following diags\n if line_sensor_right.get():\n pass", " i = i + 1", " if line_sensor_right.g...
# 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, # ...
[ [ 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.29, 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, # ...
[ [ 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 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.33,...
[ "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 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 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.1939, 0.0102, 0, 0.66, 0, 492, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.2041, 0.0102, 0, 0.66, 0.0435, 25, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.2143, 0.0102, 0, 0....
[ "callback_table = {}", "HOOK_1S = 1002", "HOOK_ADC = 1003", "def doNothing(f):\n print(\"in doNothing\")\n return f", " print(\"in doNothing\")", " return f", "def setHook(event):\n print(\"in setHook\")\n def _sh(f):\n print(\"in _sh\")\n callback_table[event] = f\n ...
# 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 2013 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.1044, 0.0055, 0, 0.66, 0, 810, 3, 1, 0, 0, 816, 10, 1 ], [ 14, 0, 0.1099, 0.0055, 0, 0.66, 0.5, 553, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.1154, 0.0055, 0, 0...
[ "l = range(5)", "s = \"Some string\"", "t = (2,5,6)" ]
# 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.5862, 0.0345, 0, 0.66, 0, 938, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.6207, 0.0345, 0, 0.66, 0.2, 0, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.6897, 0.0345, 0, 0.66, ...
[ "d1 = {}", "d1[1] = \"one\"", "d2 = {}", "d2[2] = \"two\"", "import dict", "rv = dict.update(d1, d2)" ]
# 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, # ...
[ [ 8, 0, 0.1961, 0.0294, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 3, 0, 0.5931, 0.7255, 0, 0.66, 0.2, 491, 0, 2, 0, 0, 0, 0, 0 ], [ 2, 1, 0.4461, 0.3922, 1, 0.52, ...
[ "\"\"\"__NATIVE__\n#include <stdio.h>\n\"\"\"", "class File():\n\n def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmObj_t pfn;\n pPmObj_t pn;\n pPmObj_t pattrs;", " def __init__(self, fn):\n \"\"\"__NATIVE__\n pPmObj_t pself;\n pPmOb...
# 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.9474, 0.0526, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 8, 0, 1, 0.0526, 0, 0.66, 1, 535, 3, 1, 0, 0, 0, 0, 2 ] ]
[ "import sys", "print(sys.heap())" ]
# 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.74, 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, # ...
[ [ 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.53, 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 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.32, 0, 555, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 2, 0.6714, 0.1143, 2, 0.35, 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 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 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 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.8182, 0.0455, 0, 0.66, 0, 190, 1, 0, 0, 0, 0, 2, 0 ], [ 8, 0, 0.8636, 0.0455, 0, 0.66, 0.5, 535, 3, 2, 0, 0, 0, 0, 1 ], [ 8, 0, 1, 0.0455, 0, 0.66, 1...
[ "x = 1.1", "print(\"1.1 = \", x)", "print(\"1.1 + 1.1 == \", x+x, \" Endian test passes.\")" ]
# 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 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.21, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 8, 1, 1, 0.0476, 1, 0.21, 1, ...
[ "if ismain():\n print(\"In main.\")\nelse:\n print(\"Not in main.\")", " print(\"In main.\")", " print(\"Not in main.\")" ]
# 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.7826, 0.0435, 0, 0.66, 0, 430, 0, 1, 0, 0, 430, 0, 0 ], [ 14, 0, 0.8696, 0.0435, 0, 0.66, 0.5, 810, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.913, 0.0435, 0, 0.66...
[ "import list", "l=[]", "rv = list.append(l, 42)" ]
# 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.5, 0.0278, 0, 0.66, 0, 810, 5, 0, 0, 0, 0, 0, 1 ], [ 14, 0, 0.5833, 0.0278, 0, 0.66, 0.6667, 810, 5, 0, 0, 0, 0, 0, 1 ], [ 8, 0, 0.6111, 0.0278, 0, 0.66,...
[ "l = [x for x in range(5)]", "l = [x*2 for x in range(5)]", "print(\"[x*2 for x in range(5)] = \", l)", "mat = [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ]" ]
# # 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 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.9, ...
[ "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 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, # ...
[ [ 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.15...
[ "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, # ...
[ [ 8, 0, 0.9545, 0.0455, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ] ]
[ "print(\"Expect AssertionError:\")" ]
# 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 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 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.4615, 0.0256, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.5128, 0.0256, 0, 0.66, 0.2, 97, 1, 0, 0, 0, 0, 1, 0 ], [ 2, 0, 0.6538, 0.1538, 0, 0.66,...
[ "import sys", "sharedVar = 42", "def f1():\n global sharedVar\n print(\"f1: sharedVar is \", sharedVar)\n while sharedVar == 42:\n pass\n print(\"f1: sharedVar is \", sharedVar)", " print(\"f1: sharedVar is \", sharedVar)", " while sharedVar == 42:\n pass", " print(\"f1:...
# 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, # ...
[ [ 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, # ...
[ [ 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 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 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 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, # ...
[ [ 14, 0, 0.6897, 0.0345, 0, 0.66, 0, 475, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.7241, 0.0345, 0, 0.66, 0.1111, 756, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.7586, 0.0345, 0, 0...
[ "a = \"123\\x08456\"", "b = 987", "c = [a,b]", "d = {a:b}", "e = (c,d)", "print(a)", "print(b)", "print(c)", "print(d)", "print(e)" ]
# 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 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.3469, 0.0204, 0, 0.66, 0, 535, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.3878, 0.0204, 0, 0.66, 0.1429, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 14, 0, 0.551, 0.0204, 0, 0....
[ "print(\"Exercising string.join()\")", "import string", "e1 = ()", "e2 = []", "t = (\"check\", \"this\", \"out\")", "l = [\"check\", \"this\", \"out\"]", "j = ('', '\\x00', '\\x04', '\\n', ' ', '!', '\\xff', \"foo\")", "for c in j:\n je1 = string.join(e1, c)\n je2 = string.join(e2, c)\n asser...
# 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, # ...
[]
[]
# 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)" ]
# 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.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, # ...
[ [ 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.7097, 0.0323, 0, 0.66, 0, 773, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.7742, 0.0323, 0, 0.66, 0.3333, 658, 0, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.871, 0.0323, 0, 0....
[ "n = 1", "n0 = +n", "n1 = ~n", "n2 = -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.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])" ]