Port to Python 3 - non-tutorial examples
James Cameron
4 years ago
0 | 0 | import pippy |
1 | 1 | |
2 | for i in xrange(0, 50): | |
2 | for i in range(0, 50): | |
3 | 3 | pippy.console.clear() |
4 | 4 | if i < 25: |
5 | 5 | pippy.console.red() |
7 | 7 | pippy.console.blue() |
8 | 8 | |
9 | 9 | # Note that we have to escape backslashes |
10 | print '\\o/' | |
11 | print '_|_' | |
12 | print ' ' | |
10 | print('\\o/') | |
11 | print('_|_') | |
12 | print(' ') | |
13 | 13 | pippy.wait() |
14 | 14 | |
15 | 15 | pippy.console.clear() |
16 | print '_o_' | |
17 | print ' | ' | |
18 | print '/ \\' | |
16 | print('_o_') | |
17 | print(' | ') | |
18 | print('/ \\') | |
19 | 19 | pippy.wait() |
20 | 20 | |
21 | 21 | pippy.console.clear() |
22 | print ' o ' | |
23 | print '/|\\' | |
24 | print '| |' | |
22 | print(' o ') | |
23 | print('/|\\') | |
24 | print('| |') | |
25 | 25 | pippy.wait() |
26 | 26 | |
27 | 27 | pippy.console.clear() |
28 | print '_o_' | |
29 | print ' | ' | |
30 | print '/ \\' | |
28 | print('_o_') | |
29 | print(' | ') | |
30 | print('/ \\') | |
31 | 31 | pippy.wait() |
0 | # -*- coding: utf-8 -*- | |
1 | # This is the game life http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life | |
2 | ||
3 | import os | |
4 | import time | |
5 | import random | |
6 | ||
7 | ||
8 | def LoadCells(rows, cols): | |
9 | """ We need a function to load cells in the neighborhood """ | |
10 | grid = [] | |
11 | col = [0] * cols | |
12 | # first we load an empty grid | |
13 | for i in range(rows): | |
14 | col = [0] * cols | |
15 | grid.append(col) | |
16 | # then we load some cells | |
17 | for x in range(rows): | |
18 | for y in range(cols): | |
19 | cell = random.randint(0, random.randint(0, 1)) | |
20 | grid[x][y] = cell | |
21 | return grid | |
22 | ||
23 | ||
24 | def DrawGrid(grid): | |
25 | """ Here we draw the grid """ | |
26 | """ Test: Print the number of neighbors of living cells """ | |
27 | rows = len(grid) | |
28 | cols = len(grid[1]) | |
29 | # print rows, cols | |
30 | for x in range(rows): | |
31 | for y in range(cols): | |
32 | if grid[x][y] != 1: | |
33 | print '.', | |
34 | else: | |
35 | neighbors = CountNeighbors(grid, x, y) | |
36 | print chr(neighbors+48), | |
37 | # print 'o', | |
38 | print '\n', | |
39 | ||
40 | ||
41 | def CountNeighbors(grid, x, y): | |
42 | """ Count neighbors arround a single cell""" | |
43 | ||
44 | neighbors = 0 | |
45 | rows = len(grid) | |
46 | cols = len(grid[1]) | |
47 | ||
48 | # if x < (rows - 1) and grid[x + 1][y] == 1: | |
49 | # neighbors += 1 | |
50 | # if x > 0 and grid[x - 1][y] == 1: | |
51 | # neighbors += 1 | |
52 | # if y < (cols - 1) and grid[x][y + 1] == 1: | |
53 | # neighbors += 1 | |
54 | # if y > 0 and grid[x][y - 1] == 1: | |
55 | # neighbors += 1 | |
56 | # if x < (rows - 1) and y < (cols - 1) and grid[x + 1][y + 1] == 1: | |
57 | # neighbors += 1 | |
58 | # if x > 0 and y > 0 and grid[x - 1][y - 1] == 1: | |
59 | # neighbors += 1 | |
60 | # if x > 0 and y < (cols - 1) and grid[x - 1][y + 1] == 1: | |
61 | # neighbors += 1 | |
62 | # if x < (rows - 1) and y > 0 and grid[x + 1][y - 1] == 1: | |
63 | # neighbors += 1 | |
64 | ||
65 | neighbors += grid[(x+rows-1) % rows][(y+cols-1) % cols] | |
66 | neighbors += grid[(x+rows-1) % rows][ y ] | |
67 | neighbors += grid[(x+rows-1) % rows][(y +1) % cols] | |
68 | neighbors += grid[ x ][(y+cols-1) % cols] | |
69 | # neighbors += grid[ x ][ y ] | |
70 | neighbors += grid[ x ][(y +1) % cols] | |
71 | neighbors += grid[(x +1) % rows][(y+cols-1) % cols] | |
72 | neighbors += grid[(x +1) % rows][ y ] | |
73 | neighbors += grid[(x +1) % rows][(y +1) % cols] | |
74 | ||
75 | return neighbors | |
76 | ||
77 | ||
78 | def Iteration(grid): | |
79 | """ here we define a single iteration : | |
80 | # if we have between 3 and 6 neighbors the single cell lives | |
81 | # in other case the cell dies | |
82 | If a living cell has 2 or 3 neighbors, it survives | |
83 | in other cases it dies. | |
84 | A dead cell with 3 neighbors will become alive. | |
85 | """ | |
86 | rows = len(grid) | |
87 | cols = len(grid[1]) | |
88 | ||
89 | # grid0 = grid # Save the original grid for proper counts | |
90 | grid0 = [] | |
91 | col = [0] * cols | |
92 | # First we load an empty grid | |
93 | for x in range(rows): | |
94 | col = [0] * cols | |
95 | grid0.append(col) | |
96 | ||
97 | for x in range(rows): | |
98 | for y in range(cols): | |
99 | cell = grid[x][y] | |
100 | grid0[x][y] = cell | |
101 | ||
102 | # neighbors = 0 | |
103 | for x in range(rows): | |
104 | for y in range(cols): | |
105 | neighbors = CountNeighbors(grid0, x, y) | |
106 | if grid0[x][y] == 1: | |
107 | if neighbors < 2 or neighbors > 3: | |
108 | grid[x][y] = 0 | |
109 | else: | |
110 | if neighbors == 3: | |
111 | grid[x][y] = 1 | |
112 | ||
113 | return grid | |
114 | ||
115 | def Iterator(rows, cols, pulses): | |
116 | """ Iterate n pulses and draws the result of each one """ | |
117 | pulse = 1 | |
118 | grid = LoadCells(rows, cols) | |
119 | while pulse <= pulses: | |
120 | # os.system('clear') | |
121 | print 'Pulse: ', pulse | |
122 | # Iteration(grid) | |
123 | grid = Iteration(grid) | |
124 | DrawGrid(grid) | |
125 | pulse += 1 | |
126 | time.sleep(0.2) | |
127 | ||
128 | number = input('Please input the number of rows and cols (unique number):') | |
129 | pulses = input('Please input the number of pulses:') | |
130 | Iterator(number, 4*number, pulses) | |
0 | # -*- coding: utf-8 -*- | |
1 | # This is the game life http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life | |
2 | ||
3 | import os | |
4 | import time | |
5 | import random | |
6 | ||
7 | ||
8 | def LoadCells(rows, cols): | |
9 | """ We need a function to load cells in the neighborhood """ | |
10 | grid = [] | |
11 | col = [0] * cols | |
12 | # first we load an empty grid | |
13 | for i in range(rows): | |
14 | col = [0] * cols | |
15 | grid.append(col) | |
16 | # then we load some cells | |
17 | for x in range(rows): | |
18 | for y in range(cols): | |
19 | cell = random.randint(0, random.randint(0, 1)) | |
20 | grid[x][y] = cell | |
21 | return grid | |
22 | ||
23 | ||
24 | def DrawGrid(grid): | |
25 | """ Here we draw the grid """ | |
26 | """ Test: Print the number of neighbors of living cells """ | |
27 | rows = len(grid) | |
28 | cols = len(grid[1]) | |
29 | # print rows, cols | |
30 | for x in range(rows): | |
31 | for y in range(cols): | |
32 | if grid[x][y] != 1: | |
33 | print('.', end=' ') | |
34 | else: | |
35 | neighbors = CountNeighbors(grid, x, y) | |
36 | print(chr(neighbors+48), end=' ') | |
37 | # print 'o', | |
38 | print('\n', end=' ') | |
39 | ||
40 | ||
41 | def CountNeighbors(grid, x, y): | |
42 | """ Count neighbors arround a single cell""" | |
43 | ||
44 | neighbors = 0 | |
45 | rows = len(grid) | |
46 | cols = len(grid[1]) | |
47 | ||
48 | # if x < (rows - 1) and grid[x + 1][y] == 1: | |
49 | # neighbors += 1 | |
50 | # if x > 0 and grid[x - 1][y] == 1: | |
51 | # neighbors += 1 | |
52 | # if y < (cols - 1) and grid[x][y + 1] == 1: | |
53 | # neighbors += 1 | |
54 | # if y > 0 and grid[x][y - 1] == 1: | |
55 | # neighbors += 1 | |
56 | # if x < (rows - 1) and y < (cols - 1) and grid[x + 1][y + 1] == 1: | |
57 | # neighbors += 1 | |
58 | # if x > 0 and y > 0 and grid[x - 1][y - 1] == 1: | |
59 | # neighbors += 1 | |
60 | # if x > 0 and y < (cols - 1) and grid[x - 1][y + 1] == 1: | |
61 | # neighbors += 1 | |
62 | # if x < (rows - 1) and y > 0 and grid[x + 1][y - 1] == 1: | |
63 | # neighbors += 1 | |
64 | ||
65 | neighbors += grid[(x+rows-1) % rows][(y+cols-1) % cols] | |
66 | neighbors += grid[(x+rows-1) % rows][ y ] | |
67 | neighbors += grid[(x+rows-1) % rows][(y +1) % cols] | |
68 | neighbors += grid[ x ][(y+cols-1) % cols] | |
69 | # neighbors += grid[ x ][ y ] | |
70 | neighbors += grid[ x ][(y +1) % cols] | |
71 | neighbors += grid[(x +1) % rows][(y+cols-1) % cols] | |
72 | neighbors += grid[(x +1) % rows][ y ] | |
73 | neighbors += grid[(x +1) % rows][(y +1) % cols] | |
74 | ||
75 | return neighbors | |
76 | ||
77 | ||
78 | def Iteration(grid): | |
79 | """ here we define a single iteration : | |
80 | # if we have between 3 and 6 neighbors the single cell lives | |
81 | # in other case the cell dies | |
82 | If a living cell has 2 or 3 neighbors, it survives | |
83 | in other cases it dies. | |
84 | A dead cell with 3 neighbors will become alive. | |
85 | """ | |
86 | rows = len(grid) | |
87 | cols = len(grid[1]) | |
88 | ||
89 | # grid0 = grid # Save the original grid for proper counts | |
90 | grid0 = [] | |
91 | col = [0] * cols | |
92 | # First we load an empty grid | |
93 | for x in range(rows): | |
94 | col = [0] * cols | |
95 | grid0.append(col) | |
96 | ||
97 | for x in range(rows): | |
98 | for y in range(cols): | |
99 | cell = grid[x][y] | |
100 | grid0[x][y] = cell | |
101 | ||
102 | # neighbors = 0 | |
103 | for x in range(rows): | |
104 | for y in range(cols): | |
105 | neighbors = CountNeighbors(grid0, x, y) | |
106 | if grid0[x][y] == 1: | |
107 | if neighbors < 2 or neighbors > 3: | |
108 | grid[x][y] = 0 | |
109 | else: | |
110 | if neighbors == 3: | |
111 | grid[x][y] = 1 | |
112 | ||
113 | return grid | |
114 | ||
115 | def Iterator(rows, cols, pulses): | |
116 | """ Iterate n pulses and draws the result of each one """ | |
117 | pulse = 1 | |
118 | grid = LoadCells(rows, cols) | |
119 | while pulse <= pulses: | |
120 | # os.system('clear') | |
121 | print('Pulse: ', pulse) | |
122 | # Iteration(grid) | |
123 | grid = Iteration(grid) | |
124 | DrawGrid(grid) | |
125 | pulse += 1 | |
126 | time.sleep(0.2) | |
127 | ||
128 | number = eval(input('Please input the number of rows and cols (unique number):')) | |
129 | pulses = eval(input('Please input the number of pulses:')) | |
130 | Iterator(number, 4*number, pulses) |
5 | 5 | result = 1 |
6 | 6 | if number > 0: |
7 | 7 | result = number * factorial_recursive(number - 1) |
8 | print 'factorizing: ', number, ' result: ', result | |
8 | print('factorizing: ', number, ' result: ', result) | |
9 | 9 | return result |
10 | 10 | |
11 | 11 | |
14 | 14 | result = 1 |
15 | 15 | for i in range(1, number + 1): |
16 | 16 | result = result * i |
17 | print 'factorizing: ', i, ' result: ', result | |
17 | print('factorizing: ', i, ' result: ', result) | |
18 | 18 | return result |
19 | 19 | |
20 | 20 | |
29 | 29 | factorial_iterative(number) |
30 | 30 | delta = time.time() - start |
31 | 31 | if delta > 0: |
32 | print 'Type: ', type_s, ' in: ', 1 / delta | |
32 | print('Type: ', type_s, ' in: ', 1 / delta) | |
33 | 33 | else: |
34 | print 'Type: ', type_s | |
34 | print('Type: ', type_s) | |
35 | 35 | |
36 | 36 | # ask for a number to compute the factorial of |
37 | number = input('Please input a number:') | |
38 | print 'Calculating...' | |
37 | number = eval(input('Please input a number:')) | |
38 | print('Calculating...') | |
39 | 39 | calculate(number, 0) |
40 | 40 | calculate(number, 1) |
1 | 1 | import pippy |
2 | 2 | R = random.randrange(1, 100) |
3 | 3 | |
4 | print 'Guess a number between 1 and 100!' | |
5 | N = input('Enter a number: ') | |
4 | print('Guess a number between 1 and 100!') | |
5 | N = eval(input('Enter a number: ')) | |
6 | 6 | i = 1 |
7 | 7 | while (N != R): |
8 | 8 | if N > R: |
9 | 9 | pippy.console.red() |
10 | print 'Too big... try again' | |
10 | print('Too big... try again') | |
11 | 11 | else: |
12 | 12 | pippy.console.blue() |
13 | print 'Too small.. try again' | |
13 | print('Too small.. try again') | |
14 | 14 | pippy.console.black() |
15 | N = input('Enter a number: ') | |
15 | N = eval(input('Enter a number: ')) | |
16 | 16 | i = i + 1 |
17 | 17 | |
18 | print 'You got it in', i, 'tries' | |
18 | print('You got it in', i, 'tries') |
9 | 9 | newvector = vector[:] |
10 | 10 | for j in range(0, len(vector) - 1): |
11 | 11 | if (newvector[j] == 0): |
12 | print ' ', | |
12 | print(' ', end=' ') | |
13 | 13 | else: |
14 | print '%2d' % newvector[j], | |
14 | print('%2d' % newvector[j], end=' ') | |
15 | 15 | newvector[j] = vector[j - 1] + vector[j + 1] |
16 | ||
16 | print() | |
17 | 17 | vector = newvector[:] |
4 | 4 | pi += (4.0/a) - (4.0/b) |
5 | 5 | a += 4 |
6 | 6 | b += 4 |
7 | print pi | |
7 | print(pi) | |
8 | 8 | # Now that the result has been computed we can explore printing the result. |
9 | print "There are multiple ways to print numbers here is a quick sample." | |
10 | print "Just print it :", pi | |
11 | print "Using repr() :", repr(pi) | |
12 | print "Our approximation: %3.20f" % pi | |
13 | print "\nPi is a very famous number...." | |
9 | print("There are multiple ways to print numbers here is a quick sample.") | |
10 | print("Just print it :", pi) | |
11 | print("Using repr() :", repr(pi)) | |
12 | print("Our approximation: %3.20f" % pi) | |
13 | print("\nPi is a very famous number....") | |
14 | 14 | # Use python's math module it is faster and close enough for most computations. |
15 | 15 | import math |
16 | print "Python's Math library computes" | |
17 | print "a better value pi: %3.39f" % math.pi; # it uses...(math.atan(1.0) * 4.0) | |
16 | print("Python's Math library computes") | |
17 | print("a better value pi: %3.39f" % math.pi); # it uses...(math.atan(1.0) * 4.0) | |
18 | 18 | # when running computations based on "pi" it is good to begin with the best value you can get. |
19 | 19 | # from the gnu 'C' comiler /usr/include/math.h" |
20 | print "For reference a more exact 32 bit floating point value for pi is." | |
21 | print "Known value of pi: 3.14159265358979323846" | |
20 | print("For reference a more exact 32 bit floating point value for pi is.") | |
21 | print("Known value of pi: 3.14159265358979323846") |
12 | 12 | newvector = vector[:] |
13 | 13 | for j in range(0, len(vector) - 1): |
14 | 14 | if (newvector[j] == 0): |
15 | print ' ', | |
15 | print(' ', end=' ') | |
16 | 16 | else: |
17 | 17 | remainder = newvector[j] % modulus |
18 | 18 | if (remainder == 0): |
19 | print 'O', | |
19 | print('O', end=' ') | |
20 | 20 | else: |
21 | print '.', | |
21 | print('.', end=' ') | |
22 | 22 | newvector[j] = vector[j - 1] + vector[j + 1] |
23 | ||
23 | print() | |
24 | 24 | vector = newvector[:] |
0 | number = input('Which times table? ') | |
0 | number = eval(input('Which times table? ')) | |
1 | 1 | for i in range(1, 13): |
2 | print i, 'x', number, '=', i * number | |
2 | print(i, 'x', number, '=', i * number) |
0 | number = input('Enter a number: ') | |
0 | number = eval(input('Enter a number: ')) | |
1 | 1 | |
2 | 2 | if number > 5: |
3 | print 'Greater than 5' | |
3 | print('Greater than 5') | |
4 | 4 | elif number < 5: |
5 | print 'Less than 5' | |
5 | print('Less than 5') | |
6 | 6 | else: |
7 | print 'Number is 5!' | |
7 | print('Number is 5!') |
0 | 0 | def count_backwards(number): |
1 | print 'I have the number', number | |
1 | print('I have the number', number) | |
2 | 2 | if number > 0: |
3 | print 'Calling count_backwards again!' | |
3 | print('Calling count_backwards again!') | |
4 | 4 | count_backwards(number - 1) |
5 | 5 | else: |
6 | print 'I am done counting' | |
6 | print('I am done counting') | |
7 | 7 | |
8 | number = input('Enter a number: ') | |
8 | number = eval(input('Enter a number: ')) | |
9 | 9 | count_backwards(number) |
0 | 0 | import pippy |
1 | 1 | |
2 | print " ".join(pippy.sound.getSoundList()) | |
2 | print(" ".join(pippy.sound.getSoundList())) |
0 | name = raw_input("Type your name here: ") | |
1 | print "Hello " + name + "!" | |
0 | name = input("Type your name here: ") | |
1 | print("Hello " + name + "!") |
7 | 7 | vowels = ['a', 'e', 'i', 'o', 'u'] |
8 | 8 | |
9 | 9 | # then we ask for a string to make the replacements |
10 | text = raw_input("Please input your text to translate to jeringoso:") | |
10 | text = input("Please input your text to translate to jeringoso:") | |
11 | 11 | length = len(text) |
12 | 12 | jeringoso = "" |
13 | 13 | for i in range(length): |
17 | 17 | else: |
18 | 18 | jeringoso = jeringoso + char |
19 | 19 | |
20 | print jeringoso | |
20 | print(jeringoso) |
0 | 0 | table = { |
1 | 'Hardware & Mechanicals': 'John Watlington, Mark Foster, Mary Lou Jepsen, Yves Behar, Bret Recor, Mitch Pergola, Martin Schnitzer, Kenneth Jewell, Kevin Young, Jacques Gagne, Nicholas Negroponte, Frank Lee, Victor Chau, Albert Hsu, HT Chen, Vance Ke, Ben Chuang, Johnson Huang, Sam Chang, Alex Chu, Roger Huang, and the rest of the Quanta team, the Marvell team, the AMD team, the ChiMei team...', | |
2 | ||
3 | 'Firmware': 'Ron Minnich, Richard Smith, Mitch Bradley, Tom Sylla, Lilian Walter, Bruce Wang, James Cameron', | |
1 | 'Hardware & Mechanicals': 'John Watlington, Mark Foster, Mary Lou Jepsen, Yves Behar, Bret Recor, Mitch Pergola, Martin Schnitzer, Kenneth Jewell, Kevin Young, Jacques Gagne, Nicholas Negroponte, Frank Lee, Victor Chau, Albert Hsu, HT Chen, Vance Ke, Ben Chuang, Johnson Huang, Sam Chang, Alex Chu, Roger Huang, and the rest of the Quanta team, the Marvell team, the AMD team, the ChiMei team ...', | |
4 | 2 | |
5 | 'Kernel & Drivers': 'Jaya Kumar, Jon Corbet, Reynaldo Verdejo, Pierre Ossman, Dave Woodhouse, Matthew Garrett, Chris Ball, Andy Tanenbaum, Linus Torvalds, Dave Jones, Andres Salomon, Marcelo Tosatti..', | |
6 | ||
7 | 'Graphics systems': 'Jordan Crouse, Daniel Stone, Zephaniah Hull, Bernardo Innocenti, Behdad Esfahbod, Jim Gettys, Adam Jackson, RobertTheKing, William Orr, Simon Schampijer, Gary Martin', | |
8 | ||
9 | 'Programming': 'Guido Van Rossum, Johan Dahlin, Brian Silverman, Alan Kay, Kim Rose, Bert Freudenberg, Yoshiki Ohshima, Takashi Yamamiya, Scott Wallace, Ted Kaehler, Stephane Ducasse, Hilaire Fernandes, David Narveaz, Tim Moody, Martin Langhoff, Paul Fox, Tim Shepard, Martin Abente Lahaye, Sam Parkinson, James Cameron, Ignacio Rodriguez, Jerry Vonau, Sebastian Silva, Ana Balica, rcunning01 Frederick Grose, Prason Shukla, Emil Dudev, Christofer Yael, cheekujodhpur, Agustin Zubiaga, Daniel Francis', | |
10 | ||
11 | 'Sugar': 'Marco Pesenti Gritti, Dan Williams, Chris Blizzard, John Palmieri, Lisa Strausfeld, Christian Marc Schmidt, Takaaki Okada, Eben Eliason, Walter Bender, Tomeu Vizoso, Simon Schampijer, Reinier Heeres, Ben Saller, Martin Dengler, Benjamin Berg, Daniel Drake, Jameson Quinn, Miguel Alvarez...', | |
12 | ||
13 | 'Activities': 'Erik Blankinship, Bakhtiar Mikhak, Manusheel Gupta, J.M. Maurer (uwog) and the Abiword team, the Mozilla team, Jean Piche, Barry Vercoe, Richard Boulanger, Greg Thompson, Arjun Sarwal, Cody Lodrige, Shannon Sullivan, Idit Harel, and the MaMaMedia team, John Huang, Bruno Coudoin, Eduardo Silva, Hakon Wium Lie, Don Hopkins, Muriel de Souza Godoi, Benjamin M. Schwartz..', | |
14 | ||
15 | 'Network': 'Michael Bletsas, James Cameron, Javier Cardona, Ronak Chokshi, Polychronis Ypodimatopoulos, Simon McVittie, Dafydd Harries, Sjoerd Simons, Morgan Collett, Guillaume Desmottes, Robert McQueen..', | |
16 | ||
17 | 'Security': 'Ivan Krstic, Michael Stone, C. Scott Ananian, Noah Kantrowitz, Herbert Poetzl, Marcus Leech..', | |
18 | ||
19 | 'Content': 'SJ Klein, Mako Hill, Xavier Alvarez, Alfonso de la Guarda, Sayamindu Dasgupta, Mallory Chua, Lauren Klein, Zdenek Broz, Felicity Tepper, Andy Sisson, Christine Madsen, Matthew Steven Carlos, Justin Thorp, Ian Bicking, Christopher Fabian, Wayne Mackintosh, the OurStories team, Will Wright, Chuck Normann..', | |
20 | ||
21 | 'Testing': 'Kim Quirk, Alex Latham, Giannis Galanis, Ricardo Carrano, Zach Cerza, John Fuhrer, Tom Gilliard, Niraj Nakrani', | |
22 | ||
23 | 'Country Support': 'Carla Gomez Monroy, David Cavallo, Matt Keller, Khaled Hassounah, Antonio Battro, Audrey Choi, Habib Kahn, Arnan (Roger) Sipitakiat, Reuben Caron', | |
24 | ||
25 | 'Administrative Support': 'Nia Lewis, Felice Gardner, Lindsay Petrillose, Jill Clarke, Julia Reynolds, Tracy Price, David Robertson, Danny Clark', | |
26 | ||
27 | 'Finance & Legal': 'Eben Moglen, Bruce Parker, William Kolb, John Sare, Sandra Lee, Richard Bernstein, Jaclyn Tsai, Jaime Cheng, Robert Fadel, Charles Kane (Grasshopper), Kathy Paur, Andriani Ferti', | |
28 | ||
29 | 'PR and Media': 'Larry Weber, Jackie Lustig, Jodi Petrie, George Snell, Kyle Austin, Hilary Meserole, Erick A. Betancourt, Michael Borosky, Sylvain Lefebvre, Martin Le Sauteur', | |
30 | ||
31 | 'Directors & Advisors': 'Howard Anderson, Rebecca Allen, Ayo Kusamotu, Jose Maria Aznar, V. Michael Bove, Jr., Rodrigo Mesquita, Seymour Papert, Ted Selker, Ethan Beard (Google); John Roese (Nortel); Dandy Hsu (Quanta); Marcelo Claure (Brightstar); Gary Dillabough (eBay); Gustavo Arenas (AMD); Mike Evans (Red Hat); Ed Horowitz (SES Astra); Jeremy Philips (NewsCorp); Scott Soong (Chi Lin); Sehat Sutardja (Marvell); Joe Jacobson (MIT Media Lab); Steve Kaufman (Riverside); and Tom Meredith (MFI)', | |
32 | ||
33 | 'Pippy': 'Chris Ball, C. Scott Ananian, James Cameron, Anish Mangal' | |
34 | } | |
3 | 'Firmware': 'Ron Minnich, Richard Smith, Mitch Bradley, Tom Sylla, Lilian Walter, Bruce Wang, James Cameron ...', | |
4 | ||
5 | 'Kernel & Drivers': 'Jaya Kumar, Jon Corbet, Reynaldo Verdejo, Pierre Ossman, Dave Woodhouse, Matthew Garrett, Chris Ball, Andy Tanenbaum, Linus Torvalds, Dave Jones, Andres Salomon, Marcelo Tosatti ...', | |
6 | ||
7 | 'Graphics systems': 'Jordan Crouse, Daniel Stone, Zephaniah Hull, Bernardo Innocenti, Behdad Esfahbod, Jim Gettys, Adam Jackson, RobertTheKing, William Orr, Simon Schampijer, Gary Martin ...', | |
8 | ||
9 | 'Programming': 'Guido Van Rossum, Johan Dahlin, Brian Silverman, Alan Kay, Kim Rose, Bert Freudenberg, Yoshiki Ohshima, Takashi Yamamiya, Scott Wallace, Ted Kaehler, Stephane Ducasse, Hilaire Fernandes, David Narveaz, Tim Moody, Martin Langhoff, Paul Fox, Tim Shepard, Martin Abente Lahaye, Sam Parkinson, James Cameron, Ignacio Rodriguez, Jerry Vonau, Sebastian Silva, Ana Balica, rcunning01 Frederick Grose, Prason Shukla, Emil Dudev, Christofer Yael, cheekujodhpur, Agustin Zubiaga, Daniel Francis ...', | |
10 | ||
11 | 'Sugar': 'Marco Pesenti Gritti, Dan Williams, Chris Blizzard, John Palmieri, Lisa Strausfeld, Christian Marc Schmidt, Takaaki Okada, Eben Eliason, Walter Bender, Tomeu Vizoso, Simon Schampijer, Reinier Heeres, Ben Saller, Martin Dengler, Benjamin Berg, Daniel Drake, Jameson Quinn, Miguel Alvarez ...', | |
12 | ||
13 | 'Activities': 'Erik Blankinship, Bakhtiar Mikhak, Manusheel Gupta, J.M. Maurer (uwog) and the Abiword team, the Mozilla team, Jean Piche, Barry Vercoe, Richard Boulanger, Greg Thompson, Arjun Sarwal, Cody Lodrige, Shannon Sullivan, Idit Harel, and the MaMaMedia team, John Huang, Bruno Coudoin, Eduardo Silva, Hakon Wium Lie, Don Hopkins, Muriel de Souza Godoi, Benjamin M. Schwartz ...', | |
14 | ||
15 | 'Network': 'Michael Bletsas, James Cameron, Javier Cardona, Ronak Chokshi, Polychronis Ypodimatopoulos, Simon McVittie, Dafydd Harries, Sjoerd Simons, Morgan Collett, Guillaume Desmottes, Robert McQueen ...', | |
16 | ||
17 | 'Security': 'Ivan Krstic, Michael Stone, C. Scott Ananian, Noah Kantrowitz, Herbert Poetzl, Marcus Leech ...', | |
18 | ||
19 | 'Content': 'SJ Klein, Mako Hill, Xavier Alvarez, Alfonso de la Guarda, Sayamindu Dasgupta, Mallory Chua, Lauren Klein, Zdenek Broz, Felicity Tepper, Andy Sisson, Christine Madsen, Matthew Steven Carlos, Justin Thorp, Ian Bicking, Christopher Fabian, Wayne Mackintosh, the OurStories team, Will Wright, Chuck Normann ...', | |
20 | ||
21 | 'Testing': 'Kim Quirk, Alex Latham, Giannis Galanis, Ricardo Carrano, Zach Cerza, John Fuhrer, Tom Gilliard, Niraj Nakrani ...', | |
22 | ||
23 | 'Country Support': 'Carla Gomez Monroy, David Cavallo, Matt Keller, Khaled Hassounah, Antonio Battro, Audrey Choi, Habib Kahn, Arnan (Roger) Sipitakiat, Reuben Caron ...', | |
24 | ||
25 | 'Administrative Support': 'Nia Lewis, Felice Gardner, Lindsay Petrillose, Jill Clarke, Julia Reynolds, Tracy Price, David Robertson, Danny Clark ...', | |
26 | ||
27 | 'Finance & Legal': 'Eben Moglen, Bruce Parker, William Kolb, John Sare, Sandra Lee, Richard Bernstein, Jaclyn Tsai, Jaime Cheng, Robert Fadel, Charles Kane (Grasshopper), Kathy Paur, Andriani Ferti ...', | |
28 | ||
29 | 'PR and Media': 'Larry Weber, Jackie Lustig, Jodi Petrie, George Snell, Kyle Austin, Hilary Meserole, Erick A. Betancourt, Michael Borosky, Sylvain Lefebvre, Martin Le Sauteur ...', | |
30 | ||
31 | 'Directors & Advisors': 'Howard Anderson, Rebecca Allen, Ayo Kusamotu, Jose Maria Aznar, V. Michael Bove, Jr., Rodrigo Mesquita, Seymour Papert, Ted Selker, Ethan Beard (Google); John Roese (Nortel); Dandy Hsu (Quanta); Marcelo Claure (Brightstar); Gary Dillabough (eBay); Gustavo Arenas (AMD); Mike Evans (Red Hat); Ed Horowitz (SES Astra); Jeremy Philips (NewsCorp); Scott Soong (Chi Lin); Sehat Sutardja (Marvell); Joe Jacobson (MIT Media Lab); Steve Kaufman (Riverside); and Tom Meredith (MFI)', | |
32 | ||
33 | 'Pippy': 'Chris Ball, C. Scott Ananian, James Cameron, Anish Mangal ...' | |
34 | } | |
35 | 35 | |
36 | 36 | import random |
37 | 37 | import time |
46 | 46 | |
47 | 47 | while True: |
48 | 48 | reset() |
49 | print fill("OLPC would like to take this opportunity to acknowledge the community of people and projects that have made the XO laptop possible.", int(cols)) | |
49 | print(fill("OLPC would like to take this opportunity to acknowledge the community of people and projects that have made the XO laptop possible.", int(cols))) | |
50 | 50 | |
51 | subsystem = random.choice(table.keys()) | |
51 | subsystem = random.choice(list(table.keys())) | |
52 | 52 | random.choice([red, green, yellow, blue, magenta, cyan])() |
53 | 53 | #random.choice([normal, bold, underlined, inverse])() |
54 | print '\n', fill("%s: %s" % (subsystem, table[subsystem]), int(cols)) | |
54 | print('\n' + fill("%s: %s" % (subsystem, table[subsystem]), int(cols))) | |
55 | 55 | table.pop(subsystem) |
56 | 56 | if len(table) == 0: |
57 | 57 | break |