GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Update 110.md · secpersu/StarterLearningPython@b9872ed

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • 110.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎110.md‎

Copy file name to clipboardExpand all lines: 110.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,10 @@ python2默认的编码是ascii,通过encode可以将对象的编码转换为
158158

159159
import codecs
160160
codecs.open('filename', encoding='utf8')
161+
162+
经验四:声明字符串直接加u,声明的字符串就是unicode编码的字符串
163+
164+
a = u"中"
161165

162166
我还收集了网上的一片文章,也挺好的,推荐给看官:[Python2.x的中文显示方法](https://github.com/qiwsir/ITArticles/blob/master/Python/Python%E7%9A%84%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E6%96%B9%E6%B3%95.md)
163167

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.