原创 selenium自動化之訪問百度

selenium自動化 #coding=utf-8 #爲了防止亂碼問題,以及方便的添加中文註釋,把編碼格式統一定義爲utf-8 from selenium import webdriver #導入webdriver模塊 import ti

原创 unittest.skip跳過測試和unittest.expectedFailure預期失敗

 unittest.skip跳過測試方法 python unittest測試框架從python2.7開始支持設置跳過指定的測試方法或是跳過滿足某種條件的測試用例。 @unittest.skip(reason): skip(reason)裝

原创 格式符%佔位打印不同數據類型的變量

n=input("請隨便輸入") print(type(n)) #input()函數輸出的是字符串類型 print("你輸入的是%r"%n) #不知道要打印的變量n是什麼類型時,用r%佔位   a='張三' print('你好 %s'%a