首页 \ 问答 \ python:返回值问题

python:返回值问题

def skip(A, B):     while peek(A) == B:                                          peek() 和 match() 是定义好的两个函数         match(A , B) 如上函数,运行下面的代码: A = [('stop', 'the')]   B = 'stop' print peek(A) == B              # 得到 True print match(A, B)                # 得到('stop', 'the') print skip(A, B)                   # 得到 None 判断显示Ture,执行 match() 有返回值, 为啥 skip() 的返回值是None 呢?????
更新时间:2024-05-17 15:05

最满意答案

方法一:

一 打开 Apache 的配置文件 httpd.conf 。

二 将#LoadModule rewrite_module modules/mod_rewrite前面的#去掉

三 在 httpd.conf中添加:


           

 
            
RewriteEngine On
#RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+\.html
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+)\.html 1.php?__is_apache_rewrite=1&__rewrite_arg=2

           


四 要实现asp帖子URL到php帖子的映射,在 第三步的
           
之间添加:

RewriteMap tolowercase int:tolower
RewriteCond %{QUERY_STRING} (?:boardid|page|id|replyid|star|skin)\=\d+ [NC]
RewriteRule ^(.*(?:index|dispbbs))\.asp 1.php?{tolowercase:%{QUERY_STRING}}&__is_apache_rewrite=1

五 保存httpd.conf并重启Apache。

其他回答

提问人的追问   2011-08-11 09:41在哪匹配?php里还是httpd.ini 
答: 网页中的地址当然是在php文件或者你的html模板文件你去改(注:httpd.ini文件不是用来生成链接的 而是用来解释静态地址的。)如有疑问,请到 ask.tanbo.name 提问,或者email到me@tanbo.name,我将在24小时之内给您回复.
这样的话得在php文件里面修改,判断访问的地址,如果是.php的话就跳转到.html的地址,不过不建议这样做,如果真要做伪静态的话,还是把链接地址改了吧
您好!
要看您的主机是apache的还是nginx的  。   ——湖北数据中心。

相关问答

更多
  • 是单纯的404还是tp的404? 如果是单纯的404那么就是你指向的目录有问题; tp提示的错误开启debug应该很详细;
  • Nginx 安装之后便可以正常使用,若你不进行优化,那就太浪费 Nginx 这款软件了。我们的目标是利用有限的资源让你的 Nginx 发挥无限,让你的网站飞起来! 注:以下书名号(《》)只是为了区别,若复制,请复制书名号内的内容。 1、自定义404错误页面并返回404状态码 (1)、定义欲显示的404页面,放在网站根目录,比如“404.html”。 (2)、在Nginx中的http区域添加《fastcgi_intercept_errors on;》。 (3)、在Nginx中的server区域中添加《erro ...
  • 建议楼主用lnmp 一键包吧我也有用阿里云的产品. 就是用的那个. 然后ftp如果自己一个人没必要装的.直接用xftp代替ftp工具.至于伪静态, Nginx的更为简单. 如果楼主更换成Nginx的话,我直接Copy一份给你即可.至于Apache因为本人还是09年前在使用这个,所以伪静态的你自己搜索应该会有的.网上很多
  • 伪静态实现方式两种: 1. web服务器上设置.html或者.htm等后缀的页面也通过PHP来处理即可,比如Nginx或者Apache,都有这样的配置文件,设置PHP处理的文件后缀类型,这样前台请求的htm文件,实际上是PHP代码 2. 通过设置web服务器的rewrite规则来实现,每个web服务器基本上都有这个功能,看看手册即可实现 真正的静态实现: 通过CMS发布系统,后台直接生成真正的静态页面,比如新闻网站的新闻发布系统,后台录入内容后,直接生成html的静态结果页面给用户来访问,PHP有好多开源的 ...
  • 前段时间我写了一篇 ShopEx 4.84伪静态实现方法(涵盖IIS服务器以及Nginx) 的文章.应该说反响还可以吧,也因此认识了一些做网店的朋友.当然也遇到一些问题,如修改文件发生改变,这个是因为官方对一些小的细节做了修改,所以就有朋友说,你这个文件里面怎么没有那句话啊,说实话我也很无语.还有一个是无法破解被官方加密的ctl.setting.php,反馈说那个软件(Dezender)无法破解,因为我之前写那篇文章的时候的操作系统是WinXP sp2,然后我装过新的sp3系统,也请衣帮忙测试,他的环境是W ...
  • PHP伪静态配置[2021-09-07]

    方法一: 一 打开 Apache 的配置文件 httpd.conf 。 二 将#LoadModule rewrite_module modules/mod_rewrite前面的#去掉 三 在 httpd.conf中添加: RewriteEngine On #RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+\.html RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+)\.html 1.php?__is_apa ...
  • Apache还是Nginx,伪静态的规则是怎么样的,贴出来看看。
  • 修改/etc/nginx/nginx.conf,tae的话可能在conf.d里边的virtual.conf,在server里边添加伪静态规则 location / { index index.php index.html index.htm; rewrite ^(.*)/item/([0-9]+)\.html $1/item.php?id=$2 last; }大概是这样,规则要自己测试
  • RewriteEngine on RewriteRule ^version/ /version.php
  • 点-“网站信息配置” -“URL静态化”-最下边“生成伪静态规则 (如修改过规则,请先提交保存)”里面有哦,说的很明了,我就这么做的

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)