当前位置:Gxlcms > Python > pythonre正则表达式模块(RegularExpression)

pythonre正则表达式模块(RegularExpression)

时间:2021-07-01 10:21:17 帮助过:14人阅读

模块的的作用主要是用于字符串和文本处理,查找,搜索,替换等

复习一下基本的正则表达式吧

.:匹配除了换行符以为的任意单个字符

*:匹配任意字符,一个,零个,多个都能匹配得到 俗称贪婪模式

+:匹配位于+之前的一个或者多个字符

|:匹配位于|之前或者之后的字符

^:匹配行首

$:匹配行尾

?:匹配位于?之前的零个或者一个字符,不匹配多个字符

\:表示 \ 之后的为转义字符

[]:匹配[]之中的任意单个字符,[0-9]表示匹配0到9任意一个数字

():将位于()之内的的内容当作一个整体

{}:按{}中的次数进行匹配,100[0-9]{3}表示在100之后任意匹配一个3位数(100-999)

python中以\开头的元字符:

特殊序列符号
意义
\A
只在字符串开始进行匹配
\Z
只在字符串结尾进行匹配
\b
匹配位于开始或结尾的空字符串
\B
匹配不位于开始或结尾的空字符串
\d
相当于[0-9]
\D
相当于[^0-9]
\s
匹配任意空白字符:[\t\n\r\r\v]
\S
匹配任意非空白字符:[^\t\n\r\r\v]
\w
匹配任意数字和字母:[a-zA-Z0-9]
\W
匹配任意非数字和字母:[^a-zA-Z0-9]

正则表达式语法表

语法 意义 说明
"." 任意字符
"^" 字符串开始 '^hello'匹配'helloworld'而不匹配'aaaahellobbb'
"$" 字符串结尾 与上同理
"*"
0 个或多个字符(贪婪匹配)
<*>匹配chinaunix
"+"
1 个或多个字符(贪婪匹配
与上同理
"?"
0 个或多个字符(贪婪匹配
与上同理
*?,+?,??
以上三个取第一个匹配结果(非贪婪匹配 <*>匹配</span><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">{m,n}</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">对于前一个字符重复m到n次,{m}亦可</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">a{6}匹配6个a、a{2,4</span><span style="word-wrap: break-word; font-size: 14px">}匹配2到4个a</span></td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">{m,n}?</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; white-space: normal; font-size: 14px">对于前一个字符重复m到n次,并取尽可能少</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">‘aaaaaa</span><span style="word-wrap: break-word; font-size: 14px">'中a{2,4}只会匹配2个</span></td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">"\\"</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">特殊字符转义或者特殊序列</span></td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">[]</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">表示一个字符集</span></td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">[0-9]、[a-z</span><span style="word-wrap: break-word; font-size: 14px">]、[A-Z</span><span style="word-wrap: break-word; font-size: 14px">]、[^0]</span></td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">"|"</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">或</span></td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">A|B,或运算</span></td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(...)</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">匹配括号中任意表达式</span></td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(?#...)</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">注释,可忽略</span></td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(?=...)</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">Matches if ... matches next, but doesn't consume the string.</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">'(?=test)' </span><span style="word-wrap: break-word; font-size: 14px">在hellotest中匹配hello</span></td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(?!...)</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">Matches if ... doesn't match next.</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; white-space: normal; font-size: 14px">'(?!=test)'</span><span style="word-wrap: break-word; font-size: 14px"><span class="Apple-converted-space"> </span> </span><span style="word-wrap: break-word; font-size: 14px">若hello后面不为test,匹配hello</span><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(?<=...) </span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">Matches if preceded by ... (must be fixed length).</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; white-space: normal"><span style="word-wrap: break-word; font-size: 14px">'(?<=hello</span><span style="word-wrap: break-word; font-size: 14px">)test' </span></span><span style="word-wrap: break-word; font-size: 14px">在hellotest中匹配test</span><br style="word-wrap: break-word" /> </td> </tr> <tr style="word-wrap: break-word"> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">(?<!...)</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; font-size: 14px">Matches if not preceded by ... (must be fixed length).</span><br style="word-wrap: break-word" /> </td> <td style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; word-wrap: break-word; padding-top: 0px"><span style="word-wrap: break-word; white-space: normal; font-size: 14px">'(?<!hello)</span><span style="word-wrap: break-word; font-size: 14px">test' 在hellotest中不匹配test</span><br style="word-wrap: break-word" /> </td> </tr> </tbody> </table> <br class="Apple-interchange-newline" /> </p> <p>匹配的标志和含义</p> <p> <table border="8" align="left" style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 0px; text-transform: none; background-color: rgb(255,255,255); text-indent: 0px; margin: 0px; padding-left: 0px; border-spacing: 0px; width: 320px; padding-right: 0px; border-collapse: collapse; font: 14px/21px Verdana, Arial, Helvetica, sans-serif; white-space: normal; letter-spacing: normal; height: 141px; color: rgb(0,0,0); border-top: silver 1px solid; border-right: silver 1px solid; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <tbody style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 12px; padding-top: 0px">标志</span></strong></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><strong style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 12px; padding-top: 0px">含义</span></strong></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.I</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">忽略大小写</span></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.L</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">根据本地设置而更改\w,\W,\b,\B,\s,\S的匹配内容</span></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.M</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">多行匹配模式</span></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.S</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">使“.”元字符匹配换行符</span></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.U</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">匹配Unicode字符</span></td> </tr> <tr style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px"> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">re.X</span></td> <td style="border-bottom: silver 1px solid; border-left: silver 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; padding-right: 3px; border-collapse: collapse; border-top: silver 1px solid; border-right: silver 1px solid; padding-top: 3px"><span style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; font-size: 13px; padding-top: 0px">忽略需要匹配模式中的空格,并且可以使用"#"号注释</span></td> </tr> </tbody> </table> </p> <div><br /> </p> <p>文本内容(提取Linux下的password文件)</p> <div class="jb51code"> <pre class="brush:py;"> man:x:6:12:man:/var/cache/man:/bin/nologin </script></pre> </p> <p>re模块中有3个搜索函数,每个函数都接受3个参数(匹配模式,要匹配的字符串,进行匹配的标志),如果匹配到了就返回一个对象实例,么有就返会None.</p> <p>findall():用于在字符串中查找符合正则表达式的字符串,并返回这些字符串的列表</p> <p>search():搜索整个字符串,返回对象实例</p> <p>match():只从第一个字符开始匹配,后面的不再匹配,返回对象实例</p> <div class="jb51code"> <pre class="brush:py;"> lovelinux@LoveLinux:~/py/boke$ cat text man:x:6:12:man:/var/cache/man:/bin/sh lovelinux@LoveLinux:~/py/boke$ cat test.py #/usr/bin/env python #coding:utf-8 import re with open('text','r') as txt: f = txt.read() print re.match('bin',f) print re.search('bin',f).end() lovelinux@LoveLinux:~/py/boke$ python test.py None 34 lovelinux@LoveLinux:~/py/boke$ vim test.py lovelinux@LoveLinux:~/py/boke$ python test.py None <_sre.SRE_Match object at 0x7f12fc9f9ed0> </script></pre> </p> <p>返回是对象实例有2个方法,</p> <p>start():返回记录匹配到字符的开始索引 </p> <p>end():返回记录匹配到字符的结束索引</p> <div class="jb51code"> <pre class="brush:py;"> lovelinux@LoveLinux:~/py/boke$ python test.py None 31 34 lovelinux@LoveLinux:~/py/boke$ cat test.py #/usr/bin/env python #coding:utf-8 import re with open('text','r') as txt: f = txt.read() print re.match('bin',f) print re.search('bin',f).start() print re.search('bin',f).end() </script></pre> </div> <div class=""> <ul class="m-news-opt fix"> <li class="opt-item"> <a href='/python-356412.html' target='_blank'><p>< 上一篇</p><p class="ellipsis">Python编程语言的35个与众不同之处(语言特征和使用技巧)</p></a> </li> <li class="opt-item ta-r"> <a href='/python-356414.html' target='_blank'><p>下一篇 ></p><p class="ellipsis">使用Python获取Linux系统信息的代码</p></a> </li> </ul> </div> </div> </div> <div class="g-title fix"> <h2 class="title-txt">人气教程排行</h2> </div> <div class="m-rank u-dashed mb40"> <ul> <li class="rank-item"> <a href="/python-361871.html" title='对Python2.7pandas中的read_excel详解' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">384次</span> <span class="g-sort-num top">1</span> 对Python2.7pandas中的read_excel详解 </a> </li> <li class="rank-item"> <a href="/python-357851.html" title='Python实现定时弹窗提醒' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">383次</span> <span class="g-sort-num second">2</span> Python实现定时弹窗提醒 </a> </li> <li class="rank-item"> <a href="/python-359898.html" title='python爬虫入门(3)--利用requests构建知乎API' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">383次</span> <span class="g-sort-num third">3</span> python爬虫入门(3)--利用requests构建知乎API </a> </li> <li class="rank-item"> <a href="/python-361328.html" title='python如何爬取搜狗微信公众号文章永久链接的思路解析' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">382次</span> <span class="g-sort-num ">4</span> python如何爬取搜狗微信公众号文章永久链接的思路解析 </a> </li> <li class="rank-item"> <a href="/python-363639.html" title='python字典的键可以相同吗' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">381次</span> <span class="g-sort-num ">5</span> python字典的键可以相同吗 </a> </li> <li class="rank-item"> <a href="/python-462846.html" title='python是一种面向什么的语言?' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">381次</span> <span class="g-sort-num ">6</span> python是一种面向什么的语言? </a> </li> <li class="rank-item"> <a href="/python-355903.html" title='python通过pil为png图片填充上背景颜色的方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">381次</span> <span class="g-sort-num ">7</span> python通过pil为png图片填充上背景颜色的方法 </a> </li> <li class="rank-item"> <a href="/python-364233.html" title='python语言的编程模式有什么' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">380次</span> <span class="g-sort-num ">8</span> python语言的编程模式有什么 </a> </li> <li class="rank-item"> <a href="/python-353438.html" title='使用python获取进程pid号的方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">380次</span> <span class="g-sort-num ">9</span> 使用python获取进程pid号的方法 </a> </li> <li class="rank-item"> <a href="/python-362615.html" title='Python中如何解决无限循环的问题' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">380次</span> <span class="g-sort-num ">10</span> Python中如何解决无限循环的问题 </a> </li> <li class="rank-item"> <a href="/python-466149.html" title='怎么解决pip不是内部或外部命令' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">378次</span> <span class="g-sort-num ">11</span> 怎么解决pip不是内部或外部命令 </a> </li> <li class="rank-item"> <a href="/python-374795.html" title='python中def是什么意思' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">378次</span> <span class="g-sort-num ">12</span> python中def是什么意思 </a> </li> <li class="rank-item"> <a href="/python-361381.html" title='对numpy中数组元素的统一赋值实例' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">376次</span> <span class="g-sort-num ">13</span> 对numpy中数组元素的统一赋值实例 </a> </li> <li class="rank-item"> <a href="/python-378450.html" title='python的选择语句是什么语句' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">374次</span> <span class="g-sort-num ">14</span> python的选择语句是什么语句 </a> </li> <li class="rank-item"> <a href="/python-362375.html" title='Python中构造方法的解析(附示例)' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">374次</span> <span class="g-sort-num ">15</span> Python中构造方法的解析(附示例) </a> </li> <li class="rank-item"> <a href="/python-360729.html" title='关于python中引入导入与自定义模块以及外部文件的实例分享' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">373次</span> <span class="g-sort-num ">16</span> 关于python中引入导入与自定义模块以及外部文件的实例分享 </a> </li> <li class="rank-item"> <a href="/python-364421.html" title='python如何在不同类之间调用方法' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">372次</span> <span class="g-sort-num ">17</span> python如何在不同类之间调用方法 </a> </li> <li class="rank-item"> <a href="/python-462395.html" title='python中的【//】是什么运算符号' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">372次</span> <span class="g-sort-num ">18</span> python中的【//】是什么运算符号 </a> </li> <li class="rank-item"> <a href="/python-363743.html" title='python中╲t是什么' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">371次</span> <span class="g-sort-num ">19</span> python中╲t是什么 </a> </li> <li class="rank-item"> <a href="/python-357501.html" title='python同时给多个变量赋值' class="item-name ellipsis" target="_blank"> <span class="g-art-count fr">371次</span> <span class="g-sort-num ">20</span> python同时给多个变量赋值 </a> </li> </ul> </div> </div> </div> <!-- / 教程内容页 --> </div> </div> <!-- 页尾 --> <div class="footer"> 本站所有资源全部来源于网络,若本站发布的内容侵害到您的隐私或者利益,请联系我们删除!</div> <!-- / 页尾 --> <script type="text/javascript" src="/kan/js/read.js"></script> <div style="display:none"> <div class="login-box" id="login-dialog"> <div class="login-top"><a class="current" rel="nofollow" id="login1" onclick="setTab('login',1,2);" >登录</a></div> <div class="login-form" id="nav-signin"> <!-- <div class="login-ico"><a rel="nofollow" class="qq" id="qqlogin" target="_blank" href="/user-center-qqlogin.html"> QQ </a></div> --> <div class="login-box-form" id="con_login_1"> <form id="loginform" action="/user-center-login.html" method="post" onsubmit="return false;"> <p class="int-text"> <input class="email" id="username" name="username" type="text" value="用户名或Email" onfocus="if(this.value=='用户名或Email'){this.value='';}" onblur="if(this.value==''){this.value='用户名或Email';};" ></p> <p class="int-text"> <input class="password1" type="password" id="password" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';" > </p> <p class="int-info"> <label class="ui-label"> </label> <label for="agreement" class="ui-label-checkbox"> <input type="checkbox" value="" name="cookietime" id="cookietime" checked="checked" value="2592000"> <input type="hidden" name="notforward" id="notforward" value="1"> <input type="hidden" name="dosubmit" id="dosubmit" value="1">记住我的登录 </label> <a rel="nofollow" class="aright" href="/user-center-forgetpwd.html" target="_blank"> 忘记密码? </a></p> <p class="int-btn"><a rel="nofollow" id="loginbt" class="loginbtn"><span>登录</span></a></p> </form> </div> <form id="regform" action="/user-center-reg.html" method="post"> <div class="login-reg" style="display: none;" id="con_login_2"> <input type="hidden" name="t" id="t"/> <p class="int-text"> <input id="email" name="email" type="text" value="Email" onfocus="if(this.value=='Email'){this.value='';}" onblur="if(this.value==''){this.value='Email';};"></p> <p class="int-text"> <input id="uname" name="username" type="text" value="用户名或昵称" onfocus="if(this.value=='用户名或昵称'){this.value='';}" onblur="if(this.value==''){this.value='用户名或昵称';};"></p> <p class="int-text"> <input type="password" id="pwd" name="password" value="******" onBlur="if(this.value=='') this.value='******';" onFocus="if(this.value=='******') this.value='';"> </p> <p class="int-text1"><span class="inputbox"> <input id="validate" name="validate" type="text" value="验证码" onfocus="if(this.value=='验证码'){this.value='';}" onblur="if(this.value==''){this.value='验证码';};"> </span><span class="yzm-img"><img src="/user-checkcode-index" alt="看不清楚换一张" id="indexlogin"></p> <p class="int-info"> <label> <input value="" name="agreement" id="agreement" CHECKED="checked" type="checkbox"> 我已阅读<a rel="nofollow" href="/user-center-agreement.html">用户协议</a>及<a rel="nofollow" href="/user-center-agreement.html">版权声明</a></label> </p> <p class="int-btn"><input type="hidden" name="dosubmit"/> <a rel="nofollow" class="loginbtn" id="register"><span>注册</span></a></p> </div> </form> </div> </div> </div> </div> <script type="text/javascript" src="/kan/js/foot_js.js"></script> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?6dc1c3c5281cf70f49bc0bc860ec24f2"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> <script type="text/javascript" src="/layui/layui.js"></script> <script> layui.use('code', function() { layui.code({ elem: 'pre', //默认值为.layui-code about: false, skin: 'notepad', title: 'php怎么实现数据库验证跳转代码块', encode: true //是否转义html标签。默认不开启 }); }); </script> </body> </html>