code stringlengths 1 1.72M | language stringclasses 1
value |
|---|---|
import os.path
import re
import shutil
import struct
import subprocess
import sys
import zipfile2 as zipfile
import bz2
def import_boto():
global Key, S3Connection, awscreds
try:
from boto.s3.key import Key
from boto.s3.connection import S3Connection
except:
print("You need boto librar... | Python |
"""
Read and write ZIP files.
"""
# Improved by Chortos-2 in 2010 (added bzip2 support)
import struct, os, time, sys, shutil
import binascii, cStringIO, stat
import io
import re
try:
import zlib # We may need its compression method
crc32 = zlib.crc32
except ImportError:
zlib = None
crc32 = binascii.crc... | Python |
#!/usr/bin/env python
from distutils.core import setup
import glob
setup(
name='control_ascensores',
version='0.1',
description='Simulacion del entorno de un sistema de control de ascensores.',
long_description='Presenta una interfaz SCADA para controlar un grupo de ascensores en un edificio.',
au... | Python |
#!/usr/bin/env python
from distutils.core import setup
import glob
setup(
name='control_ascensores',
version='0.1',
description='Simulacion del entorno de un sistema de control de ascensores.',
long_description='Presenta una interfaz SCADA para controlar un grupo de ascensores en un edificio.',
au... | Python |
#!/usr/bin/python
#from gi.repository import Gtk
#from gi.repository import Gdk
import gtk
from decimal import Decimal
import decimal
import gobject
import threading
import math
from gtkmvc import View
class AscensorVistaPozo(View):
def __init__(self, model): #, label):
View.__init__(sel... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import gtk
import time
import random
import ascensores
from gtkmvc import Controller
from gtkmvc.adapters import Adapter
class ControladorEdificio(Controller):
def __init__(self, model, view, ascensores):
Controller.__ini... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import gtk
#gtk.gdk.threads_init()
import os
import sys
import time
import ascensores
import plc
import scada_gtk
class dialogo(gtk.Dialog):
def _cerrar(self, button):
self.d.destroy()
def _armar_men... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import os
import sys
import time
import ascensores
import controlador
import scada_gtk
if __name__ == "__main__":
e = Edificio('E1',10)
ev = EdificioVistaGtk(3)
for i in xrange(3):
a = Ascensor("A"+str(i+1), 0.2,... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import gtk
import time
import random
import ascensores
from gtkmvc import Controller
from gtkmvc.adapters import Adapter
class ControladorEdificio(Controller):
def __init__(self, model, view, ascensores):
Controller.__ini... | Python |
#!/usr/bin/python
#from gi.repository import Gtk
#from gi.repository import Gdk
import gtk
from decimal import Decimal
import decimal
import gobject
import threading
import math
from gtkmvc import View
class AscensorVistaPozo(View):
def __init__(self, model): #, label):
View.__init__(sel... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
from decimal import Decimal
import decimal
import datetime
import threading
import os
import sys
import time
from gtkmvc import Model
class TablaDeDemandas:
'''
Permite configurar y recuperar la demanda de segun dia,hora,p... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import gtk
#gtk.gdk.threads_init()
import os
import sys
import time
import ascensores
import plc
import scada_gtk
class dialogo(gtk.Dialog):
def _cerrar(self, button):
self.d.destroy()
def _armar_men... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
import os
import sys
import time
import ascensores
import controlador
import scada_gtk
if __name__ == "__main__":
e = Edificio('E1',10)
ev = EdificioVistaGtk(3)
for i in xrange(3):
a = Ascensor("A"+str(i+1), 0.2,... | Python |
#!/usr/bin/python
# -*- encoding: UTF-8 -*-
from __future__ import print_function
from decimal import Decimal
import decimal
import datetime
import threading
import os
import sys
import time
from gtkmvc import Model
class TablaDeDemandas:
'''
Permite configurar y recuperar la demanda de segun dia,hora,p... | Python |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import json
class Carta:
def __init__(self, num, nome, era, colore):
self.num = num # numero
self.nome = nome[:32] # max 32 caratteri
self.era = era
self.colore = colore
self.costo = dict(legno=0, pietra=0, argilla=0, oro=0, stoffa=0, vetro=0, papiri=0, monete... | Python |
#!/usr/bin/python2
import sys
if (len(sys.argv) != 2):
print "Usage: {0} /path/to/t/mjin2".format(sys.argv[0])
sys.exit(0)
import pymjin2
class Mover(pymjin2.SequenceListener):
def __init__(self, timer, node):
self.i = 0
self.node = node
pymjin2.SequenceListener.__init__(self)
... | Python |
#!/usr/bin/python2
import sys
if (len(sys.argv) != 2):
print "Usage: {0} /path/to/t/mjin2".format(sys.argv[0])
sys.exit(0)
dataDir = sys.argv[1] + "/Renderless"
import pymjin2
def printXMLTree(node, level = 0):
for i in range(0, level):
print " ",
print node.name, " ", node.value
for a i... | Python |
from Common import *
import mjin2
class GamePlayer(object):
def __init__(self, application):
self.actionController = None
self.application = application
self.data = {}
self.sceneCamera = None
self.sceneCameraController = None
self.scenePlayer = None
self.sce... | Python |
import mjin2
class GameXML(mjin2.XML):
def __init__(self, pathResolver):
super(GameXML, self).__init__()
self.pathResolver = pathResolver
def loadAndDereference(self, fileName):
r = self.load(fileName)
if (len(r.nodes)):
root = r.nodes[0]
proceed = True
... | Python |
"""
World of the game
"""
import mjin2
from GameObject import *
from GamePlayer import *
from GameScene import *
class World(GameObject):
scenes = { }
def __init__(self, application, pathResolver):
super(World, self).__init__(pathResolver)
self.player = GamePlayer(application)
def finish(s... | Python |
"""
Concrete application containing the World
"""
import mjin2
import os, sys
from GameConfig import *
from GameWorld import *
class GameApplication(mjin2.InputListener, mjin2.WindowListener):
def __init__(self, name, gameCfg, logFileName, worldFileName):
self.cfg = gameCfg
self.app = mjin2.Applic... | Python |
import mjin2
from Common import *
from GameXML import *
class SceneSerializer(object):
def __init__(self, pathResolver, sceneNodeFactory):
self.pathResolver = pathResolver
self.sceneNodeFactory = sceneNodeFactory
def load(self, gameScene, fileName):
self.gameScene = gameScene
s... | Python |
"""
Base class for World, Scene, and others.
"""
from GameObjectListener import *
class GameObject(object):
def __init__(self, pathResolver):
self.listeners = {"OnFinish": [],
"OnStart": []}
self.pathResolver = pathResolver
def addListener(self, event, script):
... | Python |
"""
GameConfig with registered default values
"""
import mjin2
class GameConfig(object):
def __init__(self):
self.cfg = mjin2.ConfigFile()
self.defaults = {}
def __del__(self):
del self.cfg
def get(self, key):
if (not self.__exists(key)):
raise Exception("GameCo... | Python |
"""
Common.cpp extension. Unstable functions.
"""
import mjin2
def strToBool(s):
return s.lower() == "true"
def readVec3(node):
vec = mjin2.Vec3()
for a in node.attrs:
if (a.name == "x"):
vec.x = float(a.value)
elif (a.name == "y"):
vec.y = float(a.value)
e... | Python |
from mjin2 import *
from Common import *
from GameApplication import *
from GameConfig import *
from GameObject import *
from GameObjectListener import *
from GamePlayer import *
from GameScene import *
from GameWorld import *
from GameXML import *
from SceneSerializer import *
from Translator import *
| Python |
"""
Subscribes to game objects' events and reacts.
"""
import imp
class GameObjectListener:
def __init__(self, parent, fileName):
self.parent = parent
self.fileName = fileName
self.module = imp.load_source(fileName, fileName)
| Python |
import mjin2
import os
class Translator(object):
def __init__(self, defaultLanguage):
self.setDefaultLanguage(defaultLanguage)
self.translatorDic = {}
def defaultLanguage(self):
return self.language
def id(self, text, language = "default"):
lan = language
if (languag... | Python |
"""
World scene.
"""
import mjin2
from GameObject import *
from SceneSerializer import *
class GameScene(GameObject):
def __init__(self, world, fileName):
super(GameScene, self).__init__(world.pathResolver)
self.world = world
self.scene = mjin2.Scene()
self.sceneNodeFactory = mjin2... | Python |
#!/usr/bin/env python
import time
t = time.time()
u = time.gmtime(t)
s = time.strftime('%a, %e %b %Y %T GMT', u)
print 'Content-Type: text/javascript'
print 'Cache-Control: no-cache'
print 'Date: ' + s
print 'Expires: ' + s
print ''
print 'var timeskew = new Date().getTime() - ' + str(t*1000) + ';'
| Python |
#!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | Python |
#!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... | Python |
#!/usr/bin/python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run ... | Python |
#!/usr/bin/python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run ... | Python |
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
# Alterado por marvin
urlpatterns = patterns('antimicrobiano.views',
url('^relatoriomedicos/$', 'relatorio'),
# Example:
# (r'^cetvida/', include('cetvida.foo... | Python |
# Django settings for cetvida project.
import os
# hack to accommodate Windows
CURRENT_PATH = os.path.abspath(os.path.dirname(__file__).decode('utf-8')).replace('\\', '/')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DIRNAME = os.environ['PWD']
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
D... | Python |
#coding: latin1
from django import forms
from antimicrobiano.models import Antimicrobiano
from antimicrobiano.models import Posologia
from antimicrobiano.models import Solicitacao
from antimicrobiano.models import Medico
from django.forms.models import ModelForm
class AntimicrobianoAdminForm(forms.ModelForm):
cla... | Python |
# -*- coding: utf-8 -*-
from geraldo import Report, ReportBand, ObjectValue, ReportBand, landscape,\
SystemField, BAND_WIDTH, Label, ReportGroup, SubReport
from reportlab.lib.units import cm
from reportlab.lib.pagesizes import A5
from reportlab.lib.enums import TA_CENTER, TA_RIGHT
class RelatorioMedicos(Repo... | Python |
#coding: utf8
from django.db import models
from django.forms.fields import CharField
from antimicrobiano.ddiscreto import SEXO
from antimicrobiano.ddiscreto import STATUS_SOLICITACAO
from antimicrobiano.ddiscreto import STATUS_ABERTO
from antimicrobiano.ddiscreto import SIM_NAO
from antimicrobiano.ddiscreto import NAO... | Python |
"""
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
... | Python |
#coding: utf8
from django.contrib import admin
from django.forms import TextInput
from django.db import models
from django import forms
from django.contrib import messages
from antimicrobiano.models import Paciente
from antimicrobiano.models import Medico
from antimicrobiano.models import Enfermaria
from antimicrobi... | Python |
from django.http import HttpResponse
from reports import RelatorioMedicos
from geraldo.generators import PDFGenerator
from models import Medico
def relatorio(request):
resp = HttpResponse(mimetype='application/pdf')
medico = Medico.objects.order_by('nome','id','crm')
rel = RelatorioMedicos(queryset=medic... | Python |
#coding: utf8
"""
Arquivo utilizado para armazenar as class de Dominio Discreto
"""
SEXO = (
(u'M',u'Masculino'),
(u'F', 'Feminino'),
)
DIASANOS = (
(u'D',u'Dias'),
(u'A', 'Anos'),
)
STATUS_ABERTO='1'
STATUS_APROVADO='2'
STATUS_RECUSADO='3'
STATUS_EM_ANALISE='4'
STATUS_SOLICITACAO = (
(STAT... | Python |
#
# This file defines how to build PyMite using Scons (www.scons.org)
# Usage:
# scons tags
# scons docs
# scons PLATFORM=<platform>
#
import os, string
supported_platforms = Glob("src/platform/*")
allowed_platforms = [os.path.split(x)[1] for x in map(str, supported_platforms)]
vars = Variables()
# BUILD ... | Python |
#!/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 ... | Python |
#!/usr/bin/env python
# Copyright 2007 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.
"""
==================
Interactive PyMite
==================
An interactive command line that runs on a host computer that is con... | Python |
#!/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 ... | Python |
#!/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... | Python |
#!/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... | Python |
#!/usr/bin/env python
# This file is Copyright 2003 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.
"""
Dismantles a .py file by compiling it
into a code object and recursively dismantling
and disassembling the code o... | Python |
#!/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 ... | Python |
#!/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... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
# 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,
# ... | Python |
# 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,
# ... | Python |
#
# 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... | Python |
# to get the Python executable path
import sys
# pulls in the variables set in the 'master' SConstruct file
Import("vars")
# these should match up with the source code
vars.Add("HEAP_SIZE", "Size of the VM's heap.", 0x2000)
vars.Add("IPM", "Add the interactive library to the standard lib", True)
CFLAGS = "/DHEAP_SIZ... | Python |
# 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,
# ... | Python |
# 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,
# ... | Python |
#
# 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()
| Python |
#!/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... | Python |
# 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,
# ... | Python |
# 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... | Python |
# 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... | Python |
# 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... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
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(... | Python |
# 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,
# ... | Python |
#
# 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:
| Python |
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... | Python |
#!/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... | Python |
# 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,
# ... | Python |
# 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... | Python |
# 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,
# ... | Python |
#!/usr/bin/env python
# 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 th... | Python |
# 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,
#... | Python |
# 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,
#... | Python |
# 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,
#... | Python |
#! /usr/bin/env python
"Replace CRLF with LF in argument files. Print names of changed files."
import sys, os
def main():
for filename in sys.argv[1:]:
if os.path.isdir(filename):
print filename, "Directory!"
continue
data = open(filename, "rb").read()
if '\0' in d... | Python |
# 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 pic24_dspic33 as pic
# Monitor RAM usage
import sys
print "\n\nRAM usage: (free, total): ", sys.heap()
#####################################################... | Python |
# 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,
#... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
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[... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
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[... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
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(... | Python |
# 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,
# ... | Python |
# 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,
#... | Python |
# 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,
#... | Python |
# 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,
#... | Python |
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(... | Python |
# 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,
# ... | Python |
# 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,
# ... | Python |
# 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,
# ... | Python |
Subsets and Splits
SQL Console for ajibawa-2023/Python-Code-Large
Provides a useful breakdown of language distribution in the training data, showing which languages have the most samples and helping identify potential imbalances across different language groups.