Python调试不如强类型的语言方便,显示调用栈有时非常必要,inspect模块很好用 import inspect inspect.stack() inspect.stack()返回的是一个函数栈帧列表如(已经做了一个for e in inspect(): print e 转化) (<frame object at 0x7f6ec27b2050>, '/usr/lib/python2.7/dist-packages/oslo/config/cfg.py', 495, '_is_opt_reg
count = ): != : print(chr(i),end=" ") else: print(chr(i)) count += 输出 ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z
本节重点: l 键盘按键用法 l 键盘组合键用法 l send_keys() 输入中文运行报错问题 键盘按键键用法: #coding=utf-8 from selenium import webdriver from selenium.webdriver.common.keys import Keys #需要引入keys包 import os,time driver = webdriver.Firefox() driver.get("http://passport.kuaibo.com/logi