python相關學習記錄

1.Python strip()方法:用於移除字符串頭尾指定的字符(默認爲空格或換行符)或字符序列。 eg:   str = "00000003210Runoob01230000000"; print str.strip( '0' ); # 去除首尾字符 0   str2 = " Runoob "; # 去除首尾空格 print str2.strip(); 2.os.getenv():返回環境變量
相關文章
相關標籤/搜索