Python基础_闭包和迭代器

闭包的概念:

闭包就是内层函数,对外层函数(非全局)的变量的引用,称之为闭包

可以使用__closure__来检测函数是否是闭包,使用函数名.__closure__返回是true就是闭包。

作用:

可以让一个局部变量常驻内存。

使变量更加安全。

def f1():
    name = "华山大弟子"  #常驻内存,以后什么时候调用函数使用变量的时候,都可以用。
    def f2():
        print(name)   # 闭包,在内层函数中调用外层函数的变量,称之为闭包
    return f2()
f1()
华山大弟子
name = "华山大弟子"  # 变量直接写在全局不安全(任何人使用的时候都可以改),所以要用到闭包(只有闭包中存在,只有在函数内部可改)
def f1():
    #name = "华山大弟子"  
    global name  
    name = "change"
    def f2():
        print(name)   # 闭包,在内层函数中调用外层函数的变量,称之为闭包
    return f2()
f1()
change
# 闭包的好处
from urllib.request import urlopen
def pages():
    content = urlopen("http://www.baidu.com").read()
    def get_connect():
        return content # 在函数内部使用了外部变量,闭包。
    print(get_connect.__closure__)  # 查看get_connect是否是闭包,如果有内容是闭包,如果是none则不是闭包。
    return get_connect
f = pages() #这个时候开始加载百度网页的内容
# 后面在需要使用到这里面的内容就不需要再执行非常耗时的网络连接操作了
print(f())
(<cell at 0x0000019291DC6FA8: bytes object at 0x0000019290F233A0>,)
b'<!DOCTYPE html>\n<!--STATUS OK-->\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n        \n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\t\t    \n\n\t\n        \n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\t\t    \n\n\t\n        \n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\n\t\t\t        \n\t\t\t    \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n<html>\n<head>\n    \n    <meta http-equiv="content-type" content="text/html;charset=utf-8">\n    <meta http-equiv="X-UA-Compatible" content="IE=Edge">\n\t<meta content="always" name="referrer">\n    <meta name="theme-color" content="#2932e1">\n    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />\n    <link rel="search" type="application/opensearchdescription+xml" href="/content-search.xml" title="\xe7\x99\xbe\xe5\xba\xa6\xe6\x90\x9c\xe7\xb4\xa2" />\n    <link rel="icon" sizes="any" mask href="//www.baidu.com/img/baidu_85beaf5496f291521eb75ba38eacbd87.svg">\n\t\n\t\n\t<link rel="dns-prefetch" href="//s1.bdstatic.com"/>\n\t<link rel="dns-prefetch" href="//t1.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t2.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t3.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t10.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t11.baidu.com"/>\n\t<link rel="dns-prefetch" href="//t12.baidu.com"/>\n\t<link rel="dns-prefetch" href="//b1.bdstatic.com"/>\n    \n    <title>\xe7\x99\xbe\xe5\xba\xa6\xe4\xb8\x80\xe4\xb8\x8b\xef\xbc\x8c\xe4\xbd\xa0\xe5\xb0\xb1\xe7\x9f\xa5\xe9\x81\x93</title>\n    \n\n<style id="css_index" index="index" type="text/css">html,body{height:100%}\nhtml{overflow-y:auto}\nbody{font:12px arial;text-align:;background:#fff}\nbody,p,form,ul,li{margin:0;padding:0;list-style:none}\nbody,form,#fm{position:relative}\ntd{text-align:left}\nimg{border:0}\na{color:#00c}\na:active{color:#f60}\ninput{border:0;padding:0}\n#wrapper{position:relative;_position:;min-height:100%}\n#head{padding-bottom:100px;text-align:center;*z-index:1}\n#ftCon{height:50px;position:absolute;bottom:47px;text-align:left;width:100%;margin:0 auto;z-index:0;overflow:hidden}\n#ftCon.ftConHot{margin-bottom:33px;bottom:auto;overflow:visible\\9}\n.ftCon-Wrapper{overflow:hidden;margin:0 auto;text-align:center;*width:640px}\n.qrcodeCon{text-align:center;position:absolute;bottom:132px;width:100%}\n.qrcodeConHot{text-align:center;width:100%;margin-top:-260px;margin-top:-160px\\9;padding-bottom:33px;position:relative;bottom:0}\n@media only screen and (max-height:753px){.qrcodeConHot{margin-top:-258px}}\n@media only screen and (max-height:720px){.qrcodeConHot{margin-top:-240px}}\n@media only screen and (max-height:680px){.qrcodeConHot{margin-top:-220px}}\n@media only screen and (max-height:620px){.qrcodeConHot{margin-top:-180px}}\n#qrcode{display:inline-block;*float:left;*margin-top:4px}\n#qrcode .qrcode-item{float:left}\n#qrcode .qrcode-item-2{margin-left:33px}\n#qrcode .qrcode-img{width:106px;height:106px;margin:0 auto;padding:5px;border:1px solid #f3f3f3}\n#qrcode .qrcode-item-1 .qrcode-img{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/zbios_09b6296.png) 0 0 no-repeat;background-position:5px 5px}\n#qrcode .qrcode-item-2 .qrcode-img{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/nuomi_365eabd.png) 0 0 no-repeat;background-position:5px 5px}\n@media only screen and (-webkit-min-device-pixel-ratio:2){#qrcode .qrcode-item-1 .qrcode-img{background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/zbios_x2_5869f49.png);background-size:106px 106px}\n#qrcode .qrcode-item-2 .qrcode-img{background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/nuomi_x2_55dc5b7.png);background-size:106px 106px}\n#qrcode.qrcodeHot .qrcode-item-1 .qrcode-img,#qrcode.qrcodeHot .qrcode-item-2 .qrcode-img{background-size:70px 70px}}\n#qrcode .qrcode-text{color:#999;line-height:23px}\n#qrcode .qrcode-text a{color:#999;text-decoration:none}\n#qrcode .qrcode-text p{text-align:center}\n#qrcode .qrcode-text b{color:#666;font-weight:700}\n#qrcode .qrcode-text span{letter-spacing:1px}\n#qrcode .qrcode-text .title{color:#333;font-size:16px;line-height:32px;letter-spacing:3px}\n#qrcode .qrcode-text .sub-title{color:#999;font-size:14px;line-height:14px;font-weight:300}\n#qrcode.qrcodeHot .qrcode-img{width:70px;height:70px;border-radius:12px;padding:8px}\n#qrcode.qrcodeHot .qrcode-item-1 .qrcode-img{background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/qrcode/zbios_little_99d9e00.png)\\9}\n#qrcode.qrcodeHot .qrcode-item-1 .qrcode-img,#qrcode.qrcodeHot .qrcode-item-2 .qrcode-img{background-position:8px 8px;background-size:70px}\n#qrcode.qrcodeHot .qrcode-text .title{font-size:14px;letter-spacing:normal}\n#qrcode.qrcodeHot .qrcode-text .sub-title{font-size:12px}\n.hotword-wrapper{width:600px;background:#FFF;box-shadow:0 3px 8px 0 rgba(0,0,0,.05);-moz-box-shadow:0 3px 8px 0 rgba(0,0,0,.05);-webkit-box-shadow:0 3px 8px 0 rgba(0,0,0,.05);-ms-filter:"progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color=\'#f9f9f9\')";filter:progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color=\'#f9f9f9\');border-radius:20px;margin:40px auto;text-align:center;padding:12px 20px 8px;display:none}\n.hotword-title{font-family:PingFangSC-Medium,"Microsoft YaHei";font-size:14px;color:#222;line-height:30px;display:inline-block;float:left;font-weight:700}\n.hotword-change{display:block;float:right;font-family:PingFangSC-Regular,"Microsoft YaHei";font-size:14px;color:#999;cursor:pointer;line-height:30px;text-decoration:none}\n.hotword-change:hover{color:#07f}\n.hotword-item{display:inline-block;font-family:"Microsoft YaHei";font-size:14px;color:#333;line-height:33px;width:30%;width:28%\\9;text-decoration:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:30px}\n.hotword-item:last-child{margin-right:0}\n.hotword-item:hover{color:#07f}\n.hotword-content-hide{display:none}\n.hotword-head{overflow:hidden;margin-bottom:4px}\n.hotword-row{text-align:left}\n#ftConw{display:inline-block;text-align:left;margin-left:33px;line-height:22px;position:relative;top:-2px;*float:right;*margin-left:0;*position:static}\n#ftConw,#ftConw a{color:#999}\n#ftConw{text-align:center;margin-left:0}\n.bg{background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_441e82f.png);background-repeat:no-repeat;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n.c-icon{display:inline-block;width:14px;height:14px;vertical-align:text-bottom;font-style:normal;overflow:hidden;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_441e82f.png) no-repeat 0 0;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n.c-icon-triangle-down-blue{background-position:-480px -168px}\n.c-icon-chevron-unfold2{background-position:-504px -168px}\n#m{width:720px;margin:0 auto}\n#nv a,#nv b,.btn,#lk{font-size:14px}\n#nv{height:19px;font-size:16px;margin:0 0 4px;text-align:left;text-indent:137px}\n.s_btn{width:95px;height:32px;padding-top:2px\\9;font-size:14px;background-color:#ddd;background-position:0 -48px;cursor:pointer}\n.s_btn_h{background-position:-240px -48px}\n.s_btn_wr{width:97px;height:34px;display:inline-block;background-position:-120px -48px;*position:relative;z-index:0;vertical-align:top}\n#jgwab{margin-left:19px}\n#cp .c-icon-icrlogo,.c-icon-jgwablogo{width:14px;height:17px;display:inline-block;overflow:hidden;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_441e82f.png) no-repeat;_background-image:url(http://s1.bdstatic.com/r/www/cache/static/global/img/icons_d5b04cc.gif)}\n#cp .c-icon-icrlogo{background-position:-600px -96px;position:relative;top:3px}\n.c-icon-jgwablogo{background-position:-623px -96px;position:relative;top:3px}\n#shouji{margin-right:14px}\n#u{display:none}\n#c-tips-container{display:none}\n#wrapper{min-width:810px;height:100%;min-height:600px}\n#head{position:relative;padding-bottom:0;height:100%;min-height:600px}\n#head .head_wrapper{height:100%}\n#m{position:relative}\n#fm{padding-left:40px;top:-37px}\n#lh a{margin-left:62px}\n#lh .hotword-btn-open{color:#666;margin-right:25px;padding-left:15px;display:none;cursor:pointer}\n#lh .hotword-btn-open .open-icon{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/hotword_btn_eeee3e9.png) no-repeat;background-size:60px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/hotword_btn_low_039f033.png)\\9;background-position:-31px -1px;width:15px;height:15px;display:inline-block;vertical-align:middle}\n#lh .hotword-btn-open:hover{color:#07f}\n#lh .hotword-btn-open:hover .open-icon{background-position:-46px -1px}\n#lh .hotword-btn-hide{color:#666;margin-right:25px;padding-left:15px;display:none;cursor:pointer}\n#lh .hotword-btn-hide .hide-icon{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/hotword_btn_eeee3e9.png) no-repeat;background-size:60px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/hotword_btn_low_039f033.png)\\9;background-position:-1px -1px;width:15px;height:15px;display:inline-block;vertical-align:middle}\n#lh .hotword-btn-hide:hover{color:#07f;background-position:0 0}\n#lh .hotword-btn-hide:hover .hide-icon{background-position:-16px -1px}\n#lh #seth,#lh #setf{margin-left:0}\n#lk{position:absolute;display:none;top:0;right:0;margin:33px 0}\n#lk span{font:14px "\xe5\xae\x8b\xe4\xbd\x93"}\n#nv{position:absolute;display:none;top:0;right:0}\n#lm{color:#666;width:100%;height:60px;margin-top:60px;line-height:15px;font-size:13px;position:absolute;top:0;left:0}\n#lm a{color:#666}\n#pad-version{line-height:40px}\n.s_ipt_wr.bg,.s_btn_wr.bg,#su.bg{background-image:none}\n.s_btn_wr{width:auto;height:auto;border-bottom:1px solid transparent;*border-bottom:0}\n.s_btn{width:100px;height:36px;color:#fff;font-size:15px;letter-spacing:1px;background:#3385ff;border-bottom:1px solid #2d78f4;outline:medium;*border-bottom:0;-webkit-appearance:none;-webkit-border-radius:0}\n.s_btn.btnhover{background:#317ef3;border-bottom:1px solid #2868c8;*border-bottom:0;box-shadow:1px 1px 1px #ccc}\n.s_btn_h{background:#3075dc;box-shadow:inset 1px 1px 5px #2964bb;-webkit-box-shadow:inset 1px 1px 5px #2964bb;-moz-box-shadow:inset 1px 1px 5px #2964bb;-o-box-shadow:inset 1px 1px 5px #2964bb}\n#result_logo{display:none}\n#index_logo img{display:inline-block;width:270px;height:129px}\n#s_tab{display:none}\n.s_form{position:relative;top:38.2%}\n.s_form_wrapper{position:relative;top:-191px}\n.s_ipt_wr{height:34px}\n#head .c-icon-bear-round{display:none}\n#form{margin:22px auto 0;width:641px;text-align:left;z-index:100}\n#form .bdsug,#fm .bdsug{top:35px}\n.bdsug{display:none;position:absolute;width:538px;background:#fff;border:1px solid #ccc;_overflow:hidden;box-shadow:1px 1px 3px #ededed;-webkit-box-shadow:1px 1px 3px #ededed;-moz-box-shadow:1px 1px 3px #ededed;-o-box-shadow:1px 1px 3px #ededed}\n.bdsug.bdsugbg ul{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/sugbg_1762fe7.png) 100% 100% no-repeat;background-size:100px 110px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/sugbg_90fc9cf.gif)\\9}\n.bdsug li{width:522px;color:#000;font:14px arial;line-height:25px;padding:0 8px;position:relative;cursor:default}\n.bdsug li.bdsug-s{background:#f0f0f0}\n.bdsug-store span,.bdsug-store b{color:#7A77C8}\n.bdsug-store-del{font-size:12px;color:#666;text-decoration:underline;position:absolute;right:8px;top:0;cursor:pointer;display:none}\n.bdsug-s .bdsug-store-del{display:inline-block}\n.bdsug-ala{display:inline-block;border-bottom:1px solid #e6e6e6}\n.bdsug-ala h3{line-height:14px;background:url(//www.baidu.com/img/sug_bd.png) no-repeat left center;margin:8px 0 5px;font-size:12px;font-weight:400;color:#7B7B7B;padding-left:20px}\n.bdsug-ala p{font-size:14px;font-weight:700;padding-left:20px}\n.bdsug .bdsug-direct{width:auto;padding:0;border-bottom:1px solid #f1f1f1}\n.bdsug .bdsug-direct p{color:#00c;font-weight:700;line-height:34px;padding:0 8px;cursor:pointer;white-space:nowrap;overflow:hidden}\n.bdsug .bdsug-direct p img{width:16px;height:16px;margin:7px 6px 9px 0;vertical-align:middle}\n.bdsug .bdsug-direct p span{margin-left:8px}\n.bdsug .bdsug-direct p i{font-size:12px;line-height:100%;font-style:normal;font-weight:400;color:#fff;background-color:#2b99ff;display:inline;text-align:center;padding:1px 5px;*padding:2px 5px 0;margin-left:8px;overflow:hidden}\n.bdsug .bdsug-pcDirect{color:#000;font-size:14px;line-height:30px;height:30px;background-color:#f8f8f8}\n.bdsug .bdsug-pc-direct-tip{position:absolute;right:15px;top:8px;width:55px;height:15px;display:block;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/pc_direct_42d6311.png) no-repeat 0 0}\n.bdsug li.bdsug-pcDirect-s{background-color:#f0f0f0}\n.bdsug .bdsug-pcDirect-is{color:#000;font-size:14px;line-height:22px;background-color:#f8f8f8}\n.bdsug .bdsug-pc-direct-tip-is{position:absolute;right:15px;top:3px;width:55px;height:15px;display:block;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/pc_direct_42d6311.png) no-repeat 0 0}\n.bdsug li.bdsug-pcDirect-is-s{background-color:#f0f0f0}\n.bdsug .bdsug-pcDirect-s .bdsug-pc-direct-tip,.bdsug .bdsug-pcDirect-is-s .bdsug-pc-direct-tip-is{background-position:0 -15px}\n.bdsug .bdsug-newicon{color:#929292;opacity:.7;font-size:12px;display:inline-block;line-height:22px;letter-spacing:2px}\n.bdsug .bdsug-s .bdsug-newicon{opacity:1}\n.bdsug .bdsug-newicon i{letter-spacing:0;font-style:normal}\n.bdsug .bdsug-feedback-wrap{text-align:right;background:#fafafa;color:#666;height:25px;line-height:25px;display:none}\n.bdsug .bdsug-feedback{margin-right:10px;text-decoration:underline;color:#666}\n.toggle-underline{text-decoration:none}\n.toggle-underline:hover{text-decoration:underline}\n.tools{position:absolute;right:-75px}\n#mHolder{width:62px;position:relative;z-index:296;display:none}\n#mCon{height:18px;line-height:18px;position:absolute;cursor:pointer}\n#mCon span{color:#00c;display:block;width:24px}\n#mCon .hw{text-decoration:underline;cursor:pointer;display:inline-block}\n#mCon .pinyin{display:inline-block}\n#mCon .c-icon-chevron-unfold2{margin-left:5px}\n#mMenu a{width:100%;height:100%;display:block;line-height:22px;text-indent:6px;text-decoration:none;filter:none\\9}\n#mMenu,#user ul{box-shadow:1px 1px 2px #ccc;-moz-box-shadow:1px 1px 2px #ccc;-webkit-box-shadow:1px 1px 2px #ccc;filter:progid:DXImageTransform.Microsoft.Shadow(Strength=2, Direction=135, Color=#cccccc)\\9}\n#mMenu{width:56px;border:1px solid #9b9b9b;list-style:none;position:absolute;right:27px;top:28px;display:none;background:#fff}\n#mMenu a:hover{background:#ebebeb}\n#mMenu .ln{height:1px;background:#ebebeb;overflow:hidden;font-size:1px;line-height:1px;margin-top:-1px}\n#u1 a:link,#u1 a:visited{color:#666;text-decoration:none}\n#u1 a:hover,#u1 a:active{text-decoration:underline}\n#u1 a:active{color:#00c}\n#u1{z-index:2;color:#fff;position:absolute;right:0;top:0;margin:19px 0 5px;padding:0 96px 0 0}\n#u1 .reg{display:none}\n#u1 a.pf,#u1 a.pf:visited{display:inline-block;float:left;color:#333;line-height:24px;font-size:13px;margin-left:20px;overflow:hidden;text-decoration:underline}\n#u1 a.lb,#u1 a.lb:visited,#u1 a.username{display:inline-block;float:left;color:#333;font-size:13px;line-height:24px;margin-left:20px;text-decoration:underline}\n#u1 a.bri,#u1 a.bri:visited{display:inline-block;position:absolute;right:10px;width:60px;height:23px;float:left;color:#fff;background:#38f;line-height:24px;font-size:13px;text-align:center;overflow:hidden;border-bottom:1px solid #38f;margin-left:19px;margin-right:2px}\n#u1 a.bri.brihover{display:none;text-decoration:none;color:#333;background:0 0;border-bottom:1px solid transparent;margin-left:19px}\n#u1 #lm a{color:#00c;text-decoration:underline}\n#u1 a.mnav,#u1 a.mnav:visited{float:left;color:#333;font-weight:700;line-height:24px;margin-left:20px;font-size:13px;text-decoration:underline}\n#u1 a.mnav.sp,#u1 a.mnav.sp:visited{color:#F23F40;position:relative}\n#u1 a.mnav.sp.dot::before{content:\' \';position:absolute;width:6px;height:6px;background-color:#F23F40;border-radius:50%;top:3px;right:-6px}\n#u1 a.pf:hover,#u1 a.lb:hover,#u1 a.mnav:hover{color:#00c}\n.briiconsbg{background-repeat:no-repeat;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png);background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9}\n.bdpfmenu{background-color:#fff;border:1px solid #d1d1d1;position:absolute;right:160px;width:68px;top:36px;margin-top:-1px;_margin-top:-3px;z-index:2;box-shadow:1px 1px 5px #d1d1d1;-webkit-box-shadow:1px 1px 5px #d1d1d1;-moz-box-shadow:1px 1px 5px #d1d1d1;-o-box-shadow:1px 1px 5px #d1d1d1}\n.bdpfmenu a{display:block;text-align:left;margin:0!important;padding:0 9px;line-height:26px;text-decoration:none}\n#wrapper .bdpfmenu a:link,#wrapper .bdpfmenu a:visited{background:#fff;color:#333}\n#wrapper .bdpfmenu a:hover,#wrapper .bdpfmenu a:active{background:#38f;text-decoration:none;color:#fff}\n#wrapper .bdnuarrow{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;top:-10px;left:50%;margin-left:-5px}\n#wrapper .bdnuarrow em,#wrapper .bdnuarrow i{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;border:5px solid transparent;border-style:dashed dashed solid}\n#wrapper .bdnuarrow em{border-bottom-color:#d8d8d8;top:-1px}\n#wrapper .bdnuarrow i{border-bottom-color:#fff;top:0}\n.s-isindex-wrap #wrapper .bdnuarrow{height:13px;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png) no-repeat -90px -1px}\n#wrapper .bdnuarrow.bdbriarrow{right:104px;display:none!important}\n#wrapper .bdbri{width:85px;min-height:100px;border-left:1px solid #e7e7e7;position:absolute;background-color:#f9f9f9;overflow:hidden;z-index:2;right:0;top:0}\n#prefpanel{background:#fafafa;display:none;opacity:0;position:fixed;_position:absolute;top:-359px;z-index:1000;width:100%;min-width:960px;border-bottom:1px solid #ebebeb}\n#prefpanel form{_width:850px}\n#wrapper .bdbriimgtitle{color:#333;text-align:center;width:66px;height:43px;line-height:43px;padding-top:9px;margin:0 auto;border-bottom:#f0f0f0 1px solid;font-size:13px;cursor:default}\n#wrapper .briscrollwrapper{overflow:hidden}\n#wrapper .briscrollwrapperContainer{position:relative}\n#wrapper .bdbri.bdbriimg .bdmainlink a,#wrapper .bdbri.bdbriimg .bdothlink a{display:block;text-align:center;width:66px;height:76px;margin:0 auto;border-bottom:#f0f0f0 1px solid;color:#666;text-decoration:none;overflow:hidden}\n#wrapper .bdbri.bdbriimg .bdmainlink a:visited,#wrapper .bdbri.bdbriimg .bdothlink a:visited{color:#666}\n#wrapper .bdbri.bdbriimg .bdmainlink a:hover,#wrapper .bdbri.bdbriimg .bdothlink a:hover{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdmainlink a:active,#wrapper .bdbri.bdbriimg .bdothlink a:active{color:#00c;text-decoration:underline}\n#wrapper .bdbri.bdbriimg span{width:36px;height:36px;display:block;margin:10px auto 5px;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/bdbri_icons_194ae06.png) no-repeat;cursor:pointer}\n#wrapper .bdbri.bdbriimg .bdbrimore,#wrapper .bdbri.bdbriimg .bdbrievenmore{clear:both;text-align:center}\n#wrapper .bdbri.bdbriimg .bdbrievenmore{margin-top:15px;height:30px;width:85px;overflow:hidden}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_1{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/yingxiao_b585c1e.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_2{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/zhidao_cbf2aff.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_3{width:36px;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/qqjt_9809ca8.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_4{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/image_55b5909.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_5{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/wenku_aaf198d.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_6{background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/logos/fengyunbang_1986a40.png) no-repeat;background-size:cover}\n#wrapper .bdbri.bdbriimg span.bdbriimgitem_7{background-position:-220px 0}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:link,#wrapper .bdbri.bdbriimg .bdbrievenmore a:visited{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:hover{color:#666;text-decoration:underline}\n#wrapper .bdbri.bdbriimg .bdbrievenmore a:active{color:#00c}\n.bdbriscroll-ctrl-scroll{position:absolute;top:10px;right:1px;width:8px;border-top:1px solid #e4e4e4;border-left:1px solid #e4e4e4;cursor:default;-webkit-user-select:none;-moz-user-select:none}\n.bdbriscroll-ctrl-scroll .bdbriscroll-axis{width:8px;left:0;z-index:0;position:absolute;background:#f2f2f2}\n.bdbriscroll-ctrl-scroll-touch .bdbriscroll-axis{width:7px;background:#f2f2f2}\n.bdbriscroll-ctrl-scroll-hover .bdbriscroll-axis{background:#f2f2f2}\n.bdbriscroll-ctrl-scroll .bdbriscroll-slider{overflow:hidden;width:7px;height:14px;position:absolute;left:0;z-index:10;display:none;background:#d9d9d9;margin-top:-1px;margin-left:-1px;border-right:1px solid #cecece;border-bottom:1px solid #cecece;cursor:default}\n.bdbriscroll-ctrl-scroll-touch .bdbriscroll-slider,.bdbriscroll-ctrl-scroll-hover .bdbriscroll-slider{background:#b8b8b8;border-right:1px solid #afafaf;border-bottom:1px solid #afafaf}\n.s_ipt::-webkit-input-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt::-moz-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt:-ms-input-placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.s_ipt::placeholder{padding-left:3px;color:#aaa;font-size:13px}\n.kw-placeholder{position:absolute;top:0;left:0;color:#aaa;font-size:13px;height:35px;line-height:35px;padding-left:10px;max-width:360px;z-index:99;pointer-events:none}\n.kw-placeholder.placeholders-hidden{visibility:hidden}\n.qrcode-chunwan{width:530px;height:90px;position:absolute;left:50%;margin-left:-265px;z-index:1;bottom:115px;background-size:100%;background-repeat:no-repeat;background-position:center}\n.qrcode-chunwan .close-chunwan{width:23px;height:23px;position:absolute;top:0;right:0;display:none;_display:block;background-size:100%}\n.qrcode-chunwan:hover .close-chunwan{display:block}</style>\n\n<!--[if lte IE 8]>\n<style index="index" data-compress="strip">\n.s_form{top:260px}\n</style>\n<![endif]-->\n<!--[if IE 8]>\n<style index="index" data-compress="strip">\n#u1 a.mnav,#u1 a.mnav:visited,#u1 a.lb,#u1 a.lb:visited,#u1 a.pf,#u1 a.pf:visited,#u1 a.bri,#u1 a.bri:visited{font-family:simsun;}\n</style>\n<![endif]-->\n<style data-for="debug">\n#debug{display:none!important;}\n</style>\n<style data-for="result" id="css_index_result" type="text/css">#seth{display:inline;behavior:url(#default#homepage)}\n#setf{display:inline}\n#sekj{margin-left:14px}\n#st,#sekj{display:none}\n.s_ipt_wr{border:1px solid #b6b6b6;border-color:#7b7b7b #b6b6b6 #b6b6b6 #7b7b7b;background:#fff;display:inline-block;vertical-align:top;width:539px;margin-right:0;border-right-width:0;border-color:#b8b8b8 transparent #ccc #b8b8b8;overflow:hidden}\n.wrapper_s .s_ipt_wr{width:439px}\n.wrapper_s .s_ipt{width:434px}\n.wrapper_s .s_ipt_tip{width:434px}\n.s_ipt_wr:hover,.s_ipt_wr.ipthover{border-color:#999 transparent #b3b3b3 #999}\n.s_ipt_wr.iptfocus{border-color:#4791ff transparent #4791ff #4791ff}\n.s_ipt_tip{color:#aaa;position:absolute;z-index:-10;font:16px/22px arial;height:32px;line-height:32px;padding-left:7px;overflow:hidden;width:526px}\n.s_ipt{width:526px;height:22px;font:16px/18px arial;line-height:22px;margin:6px 0 0 7px;padding:0;background:transparent;border:0;outline:0;-webkit-appearance:none}\n#kw{position:relative}\n#u .username i{background-position:-408px -144px}\n.bdpfmenu,.usermenu{border:1px solid #d1d1d1;position:absolute;width:105px;top:36px;z-index:302;box-shadow:1px 1px 5px #d1d1d1;-webkit-box-shadow:1px 1px 5px #d1d1d1;-moz-box-shadow:1px 1px 5px #d1d1d1;-o-box-shadow:1px 1px 5px #d1d1d1}\n.bdpfmenu{font-size:12px;background-color:#fff}\n.bdpfmenu a,.usermenu a{display:block;text-align:left;margin:0!important;padding:0 9px;line-height:26px;text-decoration:none}\n.briiconsbg{background-repeat:no-repeat;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png);background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9}\n#u{z-index:301;position:absolute;right:0;top:0;margin:21px 9px 5px 0;padding:0}\n.wrapper_s #u{margin-right:3px}\n#u a{text-decoration:underline;color:#333;margin:0 7px}\n.wrapper_s #u a{margin-right:0 6px}\n#u div a{text-decoration:none}\n#u a:hover{text-decoration:underline}\n#u .back_org{color:#666;float:left;display:inline-block;height:24px;line-height:24px}\n#u .bri{display:inline-block;width:24px;height:24px;float:left;line-height:24px;color:transparent;background:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_0c37e9b.png) no-repeat 4px 3px;background-size:300px 18px;background-image:url(http://s1.bdstatic.com/r/www/cache/static/home/img/icons_809ae65.gif)\\9;overflow:hidden}\n#u .bri:hover,#u .bri.brihover{background-position:-18px 3px}\n#mCon #imeSIcon{background-position:-408px -144px;margin-left:0}\n#mCon span{color:#333}\n.bdpfmenu a:link,.bdpfmenu a:visited,#u .usermenu a:link,#u .usermenu a:visited{background:#fff;color:#333}\n.bdpfmenu a:hover,.bdpfmenu a:active,#u .usermenu a:hover,#u .usermenu a:active{background:#38f;text-decoration:none;color:#fff}\n.bdpfmenu{width:70px}\n.usermenu{width:68px;right:8px}\n#wrapper .bdnuarrow{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;top:-10px;left:50%;margin-left:-5px}\n#wrapper .bdnuarrow em,#wrapper .bdnuarrow i{width:0;height:0;font-size:0;line-height:0;display:block;position:absolute;border:5px solid transparent;border-style:dashed dashed solid}\n#wrapper .bdnuarrow em{border-bottom-color:#d8d8d8;top:-1px}\n#wrapper .bdnuarrow i{border-bottom-color:#fff;top:0}\n#prefpanel{background:#fafafa;display:none;opacity:0;position:fixed;_position:absolute;top:-359px;z-index:500;width:100%;min-width:960px;border-bottom:1px solid #ebebeb}\n#prefpanel form{_width:850px}\n#kw_tip{cursor:default;display:none;margin-top:1px}\n#bds-message-wrapper{top:43px}\n.quickdelete-wrap{position:relative}\n.quickdelete-wrap input{width:500px}\n.wrapper_l .quickdelete-wrap input{width:500px}\n.wrapper_s .quickdelete-wrap input{width:402px}\ninput::-ms-clear{display:none}\n.quickdelete{width:32px;height:32px;background:url(http://s1.bdstatic.com/r/www/cache/static/global/img/quickdelete_33e3eb8.png) no-repeat;background-position:10px 10px;position:absolute;display:block}\n.quickdelete:hover{background-position:10px -24px}\n#lh a{margin-left:25px}\n.bdbriwrapper-tuiguang{display:none!important}</style>\n<!--[if IE 8]>\n<style index="index" data-compress="strip">\n.s_ipt{background-color:#FFF;}\n</style>\n<![endif]-->\n\n    \n<script data-compress="strip">\r\nfunction h(obj){\r\n    obj.style.behavior=\'url(#default#homepage)\';\r\n\tvar a = obj.setHomePage(\'//www.baidu.com/\');\r\n}\r\n</script>\n\n<noscript>\n    <meta http-equiv="refresh" content="0; url=/baidu.html?from=noscript"/>\n</noscript>\n\n    <script>window._ASYNC_START=new Date().getTime();</script>\n</head>\n\n<body link="#0000cc">\n\t<script>\n\tif (/Chrome\\/37.0.2062.94/i.test(navigator.userAgent) && (/(windows 7)|(windows nt 6.1)/i.test(navigator.userAgent))) {\n\t\tvar _chrome_37_fix = document.createElement("style");\n\t\t_chrome_37_fix.type="text/css";\n\t\t_chrome_37_fix.setAttribute("data-for","result");\n\t\t_chrome_37_fix.innerHTML = ".t,.f16,#kw,.s_ipt,.c-title,.c-title-size,.to_zhidao,.to_tieba,.to_zhidao_bottom{font-size:15px;} .ec-hospital-info-main h2,.ad-widget-gx_sck-ylzx-doctor-info h2,.ec-card-main h2,.ad-widget-h1 h2,.ad-widget-title h2,.ad-widget-small-head h2,.ad-widget-small-head h2 a,.ad-widget-header .ec-figcaption h2{font-size: 15px !important;}";\n\t\tdocument.getElementsByTagName("head")[0].appendChild(_chrome_37_fix);\n\t}\n\t</script>\n    <div id="wrapper" style="display:none;">\n        \n\n\n        \n\n\n<script>if(window.bds&&bds.util&&bds.util.setContainerWidth){bds.util.setContainerWidth();}</script><div id="head"><div class="head_wrapper"><div class="s_form"><div class="s_form_wrapper"><style>.index-logo-srcnew {display: none;}@media (-webkit-min-device-pixel-ratio: 2),(min--moz-device-pixel-ratio: 2),(-o-min-device-pixel-ratio: 2),(min-device-pixel-ratio: 2){.index-logo-src {display: none;}.index-logo-srcnew {display: inline;}}</style><div id="lg"><img hidefocus="true" class=\'index-logo-src\' src="//www.baidu.com/img/bd_logo1.png" width="270" height="129" onerror="this.src=\'//www.baidu.com/img/bd_logo1.png\';this.onerror=null;" usemap="#mp"><img hidefocus="true" class=\'index-logo-srcnew\' src="//www.baidu.com/img/bd_logo1.png?qua=high" width="270" height="129" onerror="this.src=\'//www.baidu.com/img/bd_logo1.png\';this.onerror=null;" usemap="#mp"><map name="mp"><area style="outline:none;" hidefocus="true" shape="rect" coords="0,0,270,129" href="//www.baidu.com/s?wd=%E4%BB%8A%E6%97%A5%E6%96%B0%E9%B2%9C%E4%BA%8B&tn=SE_PclogoS_8whnvm25&sa=ire_dl_gh_logo&rsv_dl=igh_logo_pcs" onmousedown="return ns_c({fm: \'tab\', tab: \'felogo\', rsv_platform: \'wwwhome\' })" target="_blank" title="\xe7\x82\xb9\xe5\x87\xbb\xe4\xb8\x80\xe4\xb8\x8b\xef\xbc\x8c\xe4\xba\x86\xe8\xa7\xa3\xe6\x9b\xb4\xe5\xa4\x9a"onmousedown="return ns_c({\'fm\':\'behs\',\'tab\':\'bdlogo\'})"></map></div><a href="/" id="result_logo" onmousedown="return c({\'fm\':\'tab\',\'tab\':\'logo\'})"><img class=\'index-logo-src\' src="//www.baidu.com/img/baidu_jgylogo3.gif" alt="\xe5\x88\xb0\xe7\x99\xbe\xe5\xba\xa6\xe9\xa6\x96\xe9\xa1\xb5" title="\xe5\x88\xb0\xe7\x99\xbe\xe5\xba\xa6\xe9\xa6\x96\xe9\xa1\xb5"><img class=\'index-logo-srcnew\' src="//www.baidu.com/img/baidu_resultlogo@2.png" alt="\xe5\x88\xb0\xe7\x99\xbe\xe5\xba\xa6\xe9\xa6\x96\xe9\xa1\xb5" title="\xe5\x88\xb0\xe7\x99\xbe\xe5\xba\xa6\xe9\xa6\x96\xe9\xa1\xb5"></a><form id="form" name="f" action="/s" class="fm "><input type="hidden" name="ie" value="utf-8"><input type="hidden" name="f" value="8"><input type="hidden" name="rsv_bp" value="1"><input type="hidden" name="rsv_idx" value="1"><input type=hidden name=ch value=""><input type=hidden name=tn value&
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值