Python Commands Flashcards
\f
ASCII Formfeed (FF)
+=
add what’s to the right, then set equal to what’s on the left
\b
ASCII Backspace (BS)
raw_input()
accepts input from the user
open()
opens a particular file, making the data it contains accessible to work with (must be assigned to a variable)
%r
formatter used for debugging
seek()
allows you to jump to a certain area within a file
>=
greater than or equal
%d
formatter that indicates a decimal number
\Uxxxxxxxx
Character with 32 bit hex value xxxxxxxx (unicode only)
\
slash character
*
asterisk
read()
can take an opened file and interpret the text it contains, which can then be printed
sys
a library built into python
\uxxxx
Character with 16 bit hex value xxxx (unicode only)
\a
ASCII Bell (BEL)
\N
character named in the unicode database (unicode only)
<
less than
+
plus
\ooo
Character with octal value ooo
%
percent - allows you to specify which values your formatters refer to
#
turns line into a comment
\t
tab character
"
double quote
displays text on the screen
=
sets a variable
\v
ASCII vertical tab (VT)
trucate()
clears out all text from a file
*args
allows you to set a series of args to a function
”””
indicates a multi-line quote
-
minus
write()
writes text to an open file
close()
closes and saves the file
\r ASCII
Carriage Return (CR)
less than or equal
'
single quote
os.path
a library built into python
def
declares a function
” or ‘
surrounds a string or line of text
python -m pydoc [command]
displays the help page for a particular command
/
slash
\n
indicates a new line
argv
a variable that accepts commands from the command line input
exists
a command within os.path that determines whether a file exists or not
>
greater than
%s
formatter indicating a string
‘w’/’r’/’a’
read, write, and append attributes to be applied when opening a file
\xhh
Character with hex value hh
from [library] import [argument]
imports certain commands from python libraries