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 revision
Previous revision
Next revisionBoth sides next revision
devwiki:python [2022/05/02 14:34] – [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>
  
Line 1135: Line 1140:
 subprocess.Popen([r'D:\Dev\Pipeline\PyDesktop\CompFolder\CompFolder.bat'], env=env2) subprocess.Popen([r'D:\Dev\Pipeline\PyDesktop\CompFolder\CompFolder.bat'], env=env2)
 </code> </code>
-  * subprocess a console app and get return, and optionally hide the pop up console when call <code pyhton>+    * subprocess a console app and get return, and optionally hide the pop up console when call <code python>
 # hide popup console for win platform only # hide popup console for win platform only
 startupinfo = subprocess.STARTUPINFO() startupinfo = subprocess.STARTUPINFO()
  • devwiki/python.txt
  • Last modified: 2024/03/25 06:36
  • by ying