1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
What Happens When A Python Hacker Gets P☃☎★♅d Off With GUI Presentation Tools
◦
Michael Hudson
I wanted to give a talk in the "one short sentence per slide" style.
Tried Open Office.
Aaarrgh!
(well, you know)
Tried a little to install Bruce.
Aaarrgh!
(not packaged)
Tried mgp.
Aaarrgh!
(random X errors)
Meanwhile had written the sentences I wanted to say in a text file.
So wrote a simple script that dug the sentences of the file and printed them one at a time.
| for slide in slides: |
| os.system('clear') |
| print '\n'*10 |
| print slide |
| raw_input() |
Problem: couldn't go backwards.
Solution: terminal hacking!
(Obviously)
Stole scary code from my old pyrepl project.
For example:
| self.__svtermstate = \ |
| tcgetattr(self.input_fd) |
| raw = self.__svtermstate.copy() |
| raw.iflag &=~ \ |
| (termios.BRKINT|termios.INPCK| |
| termios.ISTRIP|termios.IXON) |
| raw.oflag &=~ (termios.OPOST) |
| raw.cflag &=~ \ |
| (termios.CSIZE|termios.PARENB) |
| ... |
| tcsetattr( |
| self.input_fd, |
| termios.TCSADRAIN, raw) |
Then
| i = 0 |
| while i < len(slides): |
| show_slide(i) |
| e = get_event() |
| if e.name == 'left': |
| i -= 1 |
| else: |
| i += 1 |
From there, just a short step to dissolve transitions, etc.
(Background image courtesy of gnome-terminal).
|