codecamp

CherryPy 测试安装

需要验证应用程序是否已正确安装在系统中,与我们对Java等应用程序的安装方式相同。

您可以选择上一章中提到的三种方法中的任何一种,在您的环境中安装和部署CherryPy。 CherryPy必须能够从Python shell导入如下 -

import cherrypy
cherrypy.__version__
'3.0.0'

如果没有将CherryPy全局安装到本地系统的Python环境中,那么您需要设置PYTHONPATH环境变量,否则它将以下列方式显示错误 -

import cherrypy
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named cherrypy


CherryPy 使用Subversion进行安装
CherryPy 配置
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

CherryPy 一个工作应用程序

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }