Python Commands Flashcards

(49 cards)

1
Q

\f

A

ASCII Formfeed (FF)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

+=

A

add what’s to the right, then set equal to what’s on the left

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

\b

A

ASCII Backspace (BS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

raw_input()

A

accepts input from the user

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

open()

A

opens a particular file, making the data it contains accessible to work with (must be assigned to a variable)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

%r

A

formatter used for debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

seek()

A

allows you to jump to a certain area within a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

>=

A

greater than or equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

%d

A

formatter that indicates a decimal number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

\Uxxxxxxxx

A

Character with 32 bit hex value xxxxxxxx (unicode only)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

\

A

slash character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

*

A

asterisk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

read()

A

can take an opened file and interpret the text it contains, which can then be printed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

sys

A

a library built into python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

\uxxxx

A

Character with 16 bit hex value xxxx (unicode only)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

\a

A

ASCII Bell (BEL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

\N

A

character named in the unicode database (unicode only)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

<

A

less than

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

+

A

plus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

\ooo

A

Character with octal value ooo

16
Q

%

A

percent - allows you to specify which values your formatters refer to

17
Q

#

A

turns line into a comment

19
Q

\t

A

tab character

19
Q

"

21
print
displays text on the screen
22
=
sets a variable
24
\v
ASCII vertical tab (VT)
25
trucate()
clears out all text from a file
27
\*args
allows you to set a series of args to a function
28
"""
indicates a multi-line quote
29
-
minus
30
write()
writes text to an open file
32
close()
closes and saves the file
33
\r ASCII
Carriage Return (CR)
34
less than or equal
35
\'
single quote
35
os.path
a library built into python
36
def
declares a function
37
" or '
surrounds a string or line of text
39
python -m pydoc [command]
displays the help page for a particular command
40
/
slash
41
\n
indicates a new line
41
argv
a variable that accepts commands from the command line input
42
exists
a command within os.path that determines whether a file exists or not
44
\>
greater than
45
%s
formatter indicating a string
47
'w'/'r'/'a'
read, write, and append attributes to be applied when opening a file
48
\xhh
Character with hex value hh
49
from [library] import [argument]
imports certain commands from python libraries