devwiki:python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revisionBoth sides next revision
devwiki:python [2022/05/02 14:36] – [system command modules] yingdevwiki:python [2022/06/26 14:10] – [string operation] ying
Line 424: Line 424:
   * text block to clean row list <code python>   * text block to clean row list <code python>
 data_list = [row.strip() for row in source_txt.split('\n')] data_list = [row.strip() for row in source_txt.split('\n')]
 +</code>
 +
 +  * to use non-ascii character in python file, you need to put encoding in first line of code, or you will get "Non-ASCII character '\xe2' in file" error <code python>
 +# coding: utf-8
 +my_special_string = u"好"
 </code> </code>
  
  • devwiki/python.txt
  • Last modified: 2024/03/25 06:36
  • by ying