python os.system问题?

djstava 2010-05-06 04:01:37
CGI文件test.py
#!/usr/bin/env python
import os

print 'Content-Type:text/html\n'
print

os.system('firefox index.html')

但是在浏览器中打不开index.html?
谢谢。
...全文
154 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
thy38 2010-05-07
  • 打赏
  • 举报
回复
apache2可能对php支持不好。
djstava 2010-05-07
  • 打赏
  • 举报
回复
问题已经解决,是apache2的问题
huanlanshikong 2010-05-06
  • 打赏
  • 举报
回复
先要确定参数里的命令在cmd里面可以运行,试试
os.system('start firefox index.html')
djstava 2010-05-06
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 tingsking18 的回复:]

firefox的路径没加上
[/Quote]

加上也不起作用。
tingsking18 2010-05-06
  • 打赏
  • 举报
回复
firefox的路径没加上

37,720

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • IT.BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧