sys.path is a list of directory names that constitue the current import search path.
sys.path.append('/my/new/path')
everything in python is an object.
code blocks are defined by their indentation. this means whitespace is significant, and must be consistent. the fist line that is not indented is outside the function.
python uses carriage returns to separate statemetns and a colon and indentation to separate code blocks.
# regular expression
^ matches the beginning of a string.
$ matches the end of a string.
\b matches a word boundary.
\d matches any numeric digit.
\D matches any non-numeric digit.
x? matches an optional x character (an x zero or one times).
x* matches x zero or more times.
x+ matches x one or more times.
x{n,m} matches an x character at least n times, but not more than m times.
(a|b|c) matches either a or b or c.
(x) is a remembered group. I can get the value of what matched by using the groups() method of the object returned by re.search().
command + arguments = statement
a string is printed as it is, but an expression is evaluated, or converted to its actual value.
variables store data.
raw_input() returns a string while input() returns a number.
comma , at the end of a print statement keep is from swtiching to a new line.
sys.path.append('/my/new/path')
everything in python is an object.
code blocks are defined by their indentation. this means whitespace is significant, and must be consistent. the fist line that is not indented is outside the function.
python uses carriage returns to separate statemetns and a colon and indentation to separate code blocks.
# regular expression
^ matches the beginning of a string.
$ matches the end of a string.
\b matches a word boundary.
\d matches any numeric digit.
\D matches any non-numeric digit.
x? matches an optional x character (an x zero or one times).
x* matches x zero or more times.
x+ matches x one or more times.
x{n,m} matches an x character at least n times, but not more than m times.
(a|b|c) matches either a or b or c.
(x) is a remembered group. I can get the value of what matched by using the groups() method of the object returned by re.search().
command + arguments = statement
a string is printed as it is, but an expression is evaluated, or converted to its actual value.
variables store data.
raw_input() returns a string while input() returns a number.
comma , at the end of a print statement keep is from swtiching to a new line.
Comments
Post a Comment
https://gengwg.blogspot.com/