Python3 基础教程 - 廖雪峰21/531 请注意,用哪个都行,但是绝对不能用 Word 和 Windows 自带的记事本。 Word 保存的不是纯文本文件,而记事本会自作聪明地在文件开始的地 方加上几个特殊字符(UTF-8 BOM),结果会导致程序运行出现莫名其 妙的错误。 安装好文本编辑器后,输入以下代码: print('hello, world') 注意 print 前面不要有任何空格。然后,选择一个目录,例如 Python3 基础教程【完整版】 http://www.yeayee.com/ 32/531 请利用 print()输出 1024 * 768 = xxx: # -*- coding: utf-8 -*- ---- print(???) 参考源码 do_input.py Python 基础 Python 是一种计算机编程语言。计算机编程语言和我们日常使用的自然 语言有 编码转化为“可变长编码” 的 UTF-8 编码。UTF-8 编码把一个 Unicode 字符根据不同的数字大小编 码成 1-6 个字节,常用的英文字母被编码成 1 个字节,汉字通常是 3 个 字节,只有很生僻的字符才会被编码成 4-6 个字节。如果你要传输的文 本包含大量英文字符,用 UTF-8 编码就能节省空间: 字符 ASCII Unicode UTF-8 A 010000010 码力 | 531 页 | 5.15 MB | 1 年前3
Celery v4.0.0 Documentation'correlation_id': task_id, 'content_type': 'application/json', 'content_encoding': 'utf-8', } ) Changes from version 1 Protocol version detected by the presence of a task message header succeeded', 'exchange': 'celeryev', 'content_type': 'application/json', 'content_encoding': 'utf-8', 'delivery_mode': 1, } headers = { 'hostname': 'worker1@george.vandelay.com', } body = { 0.22. Includes binary wheels for Microsoft Windows x86 and x86_64! Task: Error emails now uses utf-8 character set by default (Issue #2737 [https://github.com/celery/celery/issues/2737]). Task: Retry0 码力 | 2106 页 | 2.23 MB | 1 年前3
Celery 3.0 Documentation'correlation_id': task_id, 'content_type': 'application/json', 'content_encoding': 'utf-8', } ) Changes from version 1 Protocol version detected by the presence of a task message header succeeded', 'exchange': 'celeryev', 'content_type': 'application/json', 'content_encoding': 'utf-8', 'delivery_mode': 1, } headers = { 'hostname': 'worker1@george.vandelay.com', } body = { 0.22. Includes binary wheels for Microsoft Windows x86 and x86_64! Task: Error emails now uses utf-8 character set by default (Issue #2737 [https://github.com/celery/celery/issues/2737]). Task: Retry0 码力 | 2110 页 | 2.23 MB | 1 年前3
Scrapy 1.4 Documentation'], 'Connection': ['close '], 'Content-Length': ['596'], 'Content-Type': ['text/html; charset=UTF-8'], 'Date': ['Wed, 18 Aug 2010 23:59:46 GMT'], 'Etag': ['"573c1-254-48c9c87349680"'], 'Last-Modified': XmlResponse object that will be used for selecting and extracting data. text is a unicode string or utf-8 encoded text for cases when a response isn’t available. Using text and response together is undefined ['bytes'], 'Cache-Control': ['max-age=0, must-revalidate'], 'Content-Type': ['text/html; charset=UTF-8'], 'Date': ['Thu, 08 Dec 2016 16:21:19 GMT'], 'Server': ['snooserv'], 'Set-Cookie': ['loid=KqNLou0V9SKMX4qb4n;0 码力 | 394 页 | 589.10 KB | 1 年前3
Flask Documentation (1.1.x)ASCII-encoded JSON. If this is disabled, the JSON will be returned as a Unicode string, or encoded as UTF-8 by jsonify. This has security implications when rendering the JSON into JavaScript in templates, and allowed for view_rv: str (unicode in Python 2) A response object is created with the string encoded to UTF-8 as the body. bytes (str in Python 2) A response object is created with the bytes as the body. dict text/HTML; charset=utf-8 the mimetype would be 'text/ html'. property mimetype_params The mimetype parameters as dict. For example if the content type is text/html; charset=utf-8 the params would be0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask Documentation (1.1.x)ASCII-encoded JSON. If this is disabled, the JSON will be returned as a Unicode string, or encoded as UTF-8 by jsonify. This has security implications when rendering the JSON into JavaScript in templates, and allowed for view_rv: str (unicode in Python 2) A response object is created with the string encoded to UTF-8 as the body. bytes (str in Python 2) A response object is created with the bytes as the body. dict is text/HTML; charset=utf-8 the mimetype would be 'text/html'. property mimetype_params The mimetype parameters as dict. For example if the content type is text/html; charset=utf-8 the params would be0 码力 | 428 页 | 895.98 KB | 1 年前3
Jinja2 Documentation Release 2.10Unicode literal: # -*- coding: utf-8 -*- 8 We recommend utf-8 as Encoding for Python modules and templates as it’s possible to represent every Unicode character in utf-8 and because it’s backwards compatible TemplateNotFound(template) mtime = getmtime(path) with file(path) as f: source = f.read().decode('utf-8') return source, path, lambda: mtime == getmtime(path) get_source(environment, template) Get the list of the builtin loaders Jinja2 provides: class jinja2.FileSystemLoader(searchpath, encoding=’utf-8’, followlinks=False) Loads templates from the file system. This loader can find templates in folders0 码力 | 148 页 | 475.08 KB | 1 年前3
Python 标准库参考指南 3.13 ANSI 代码页 . . . . . . . . . . . . . . . . . . . . . . . 188 7.2.7 encodings.utf_8_sig --- 带 BOM 签名的 UTF-8 编解码器 . . . . . . . . . . . . . 189 8 数据类型 191 8.1 datetime --- 基本日期和时间类型 . . . . . . . . . . . 617 16.1.1 文件名,命令行参数,以及环境变量。 . . . . . . . . . . . . . . . . . . . . . . . . . 618 16.1.2 Python UTF-8 模式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 vii 16.1.3 进程参数 __annotations__),并具有新的 __wrapped__ 属性,现在是属于与常规函数类似的可 调用对象。 class str(object=”) class str(object=b”, encoding=’utf-8’, errors=’strict’) 返回一个str 版本的 object 。有关详细信息,请参阅str() 。 str 是内置字符串class 。更多关于字符串的信息查看文本序列类型 ---0 码力 | 2246 页 | 11.74 MB | 9 月前3
Python 标准库参考指南 3.11.10 Windows ANSI 代码页 . . . . . . . . . . . . . . . . . . . . . 183 7.2.7 encodings.utf_8_sig --- 带 BOM 签名的 UTF-8 编解码器 . . . . . . . . . . . . 183 8 数据类型 185 8.1 datetime --- 基本日期和时间类型 . . . . . . . . . . . . 583 16.1.1 文件名,命令行参数,以及环境变量。 . . . . . . . . . . . . . . . . . . . . . . . . . 584 16.1.2 Python UTF-8 模式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 16.1.3 进程参数 . . __annotations__),还拥有一个新的 __wrapped__ 属性,并 且现在还可以作为普通函数进行调用。 class str(object=”) class str(object=b”, encoding=’utf-8’, errors=’strict’) 返回一个str 版本的 object 。有关详细信息,请参阅str() 。 str 是内置字符串class 。更多关于字符串的信息查看文本序列类型 ---0 码力 | 2248 页 | 11.10 MB | 9 月前3
Python 标准库参考指南 3.13 ANSI 代码页 . . . . . . . . . . . . . . . . . . . . . . . 186 7.2.7 encodings.utf_8_sig --- 带 BOM 签名的 UTF-8 编解码器 . . . . . . . . . . . . . 187 8 数据类型 189 8.1 datetime --- 基本日期和时间类型 . . . . . . . . . . . 613 16.1.1 文件名,命令行参数,以及环境变量。 . . . . . . . . . . . . . . . . . . . . . . . . . 614 16.1.2 Python UTF-8 模式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 vii 16.1.3 进程参数 __annotations__),并具有新的 __wrapped__ 属性,现在是属于与常规函数类似的可 调用对象。 class str(object=”) class str(object=b”, encoding=’utf-8’, errors=’strict’) 返回一个str 版本的 object 。有关详细信息,请参阅str() 。 str 是内置字符串class 。更多关于字符串的信息查看文本序列类型 ---0 码力 | 2242 页 | 11.73 MB | 9 月前3
共 370 条
- 1
- 2
- 3
- 4
- 5
- 6
- 37













