background preloader

Python

Facebook Twitter

Arduivis by cskonopka. About Arduivis is a compilation of models that provide a simpler way of connecting a visual programming (MaxMSP/Pure Data) language with an Arduino microcontroller without third-party externals or libraries. Where to start? Check out the MaxMSP and Pure Data models in the menu to see which fits your project. Each language will provide an Arduino sketch and a patch. Further information about the implementation can be found in the menu under Arduino examples. Requirements Microcontroller Arduino Tested/Work: UNO, Leonardo, Mega 2560, Micro, Adafruit Trinket 5v, Adafruit Trinket Pro 5v Download the Arduino IDE Visual Programming Language MaxMSP and/or PD-Extended Download the arduivis repository arduivis Contribution Christopher Konopka (@cskonopka) Contact Website: christopherkonopka.com. Not_so_obvious_python_stuff. SimplePrograms. Please note that these examples are written in Python 2, and may need some adjustment to run under Python 3. 1 line: Output print 'Hello, world!

' 2 lines: Input, assignment name = raw_input('What is your name? 3 lines: For loop, built-in enumerate function, new style formatting friends = ['john', 'pat', 'gary', 'michael'] for i, name in enumerate(friends): print "iteration {iteration} is {name}".format(iteration=i, name=name) 4 lines: Fibonacci, tuple assignment parents, babies = (1, 1) while babies < 100: print 'This generation has {0} babies'.format(babies) parents, babies = (babies, parents + babies) 5 lines: Functions def greet(name): print 'Hello', name greet('Jack') greet('Jill') greet('Bob') 6 lines: Import, regular expressions import re for test_string in ['555-1212', 'ILL-EGAL']: if re.match(r'^\d{3}-\d{4}$', test_string): print test_string, 'is a valid US local phone number' else: print test_string, 'rejected' 7 lines: Dictionaries, generator expressions 9 lines: Opening files.

Electrical Engineering and Computer Science | 6.00SC Introduction to Computer Science and Programming, Spring 2011 | Software. The Python Standard Library. This document is for an old version of Python that is no longer supported. You should upgrade and read the Python documentation for the current stable release. Navigation The Python Standard Library¶ While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python.

It also describes some of the optional components that are commonly included in Python distributions. Python’s standard library is very extensive, offering a wide range of facilities as indicated by the long table of contents listed below. The Python installers for the Windows platform usually include the entire standard library and often also include many additional components. Previous topic 9. Next topic 1. This Page Show Source Quick search © Copyright 1990-2020, Python Software Foundation. Python Lists | Computer Science.