官术网_书友最值得收藏!

  • Python for Secret Agents
  • Steven F. Lott
  • 246字
  • 2021-09-03 09:48:23

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, package names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The size_list variable is a sequence of eight-tuples built from the bytes of the encoded size."

A block of code is set as follows:

message_bytes= message.encode("UTF-8")
bits_list = list(to_bits(c) for c in message_bytes )
len_h, len_l = divmod( len(message_bytes), 256 )
size_list = [to_bits(len_h), to_bits(len_l)]
bit_sequence( size_list+bits_list )

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

w, h = ship.size
for p,m in enumerate( bit_sequence(size_list+bits_list) ):
    y, x = divmod( p, w )
    r, g, b = ship.getpixel( (x,y) )
    r_new = (r & 0xfe) | m
    print( (r, g, b), m, (r_new, g, b) )
    ship.putpixel( (x,y), (r_new, g, b)  )

Any command-line input or output is written as follows:

$ python3.3 -m doctest ourfile.py

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "There is an Advanced Settings panel that defines these file associations."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

主站蜘蛛池模板: 南华县| 泸州市| 安平县| 大悟县| 江安县| 罗山县| 石嘴山市| 莎车县| 全椒县| 伊春市| 清涧县| 永仁县| 扶风县| 信阳市| 彰化市| 南乐县| 青龙| 满洲里市| 军事| 蒙自县| 凌云县| 兴海县| 武鸣县| 和顺县| 永昌县| 诏安县| 衡阳县| 凤冈县| 买车| 靖远县| 宜阳县| 班戈县| 沙雅县| 南涧| 石台县| 扶余县| 平凉市| 浦北县| 永康市| 大渡口区| 蕲春县|