Python Programming for the Absolute Beginner, 3rd Edition

R

r file access mode, 202

r+ file access mode, 202

r shelve access mode, 212

radio buttons, 326–329

random access, 100

Random Access program example, 100–101

random module, 364

random numbers, 56

generating, 103–104

Guess My Number game example, 87

import statement, 55–56

pseudorandom, 54

randrange() function, 56–57

random.choice() function, 159

random.randrange() function, 103

randrange() function, 56–57, 284

range() function, 94, 96–97

raw_input() function, 36–37, 46, 48

read() function, 202–204, 208

Read It program example, 199–201

Read Key program example, 379–382

reading

characters

from lines, 203–204

from text files, 202–203

lines into lists, 204–205

readline() function, 203–204, 208

readlines() function, 204–205, 207–208

Receive and Return program example, 169–170

receiving messages, 264

remove() function, 137–138

repeating strings, 28, 50

repeat_interval attribute, Animation class, 430

repetition (*) operator, 28

replace() method, 40–41

return statements, 171

reveal() method, 319

reverse() function, 138, 373

root window, GUI elements

creating, 306

editing, 306

event loops, entering, 306

overview, 304–305

Rotate Sprite program, 383

rotate_by() method, 383

rotating sprites, 382–384, 397–399

row parameter, grid() method, 318

Run Script command (Edit menu), 11

Категории