当前位置: 首页>>代码示例>>Python>>正文


Python config.PORT属性代码示例

本文整理汇总了Python中config.PORT属性的典型用法代码示例。如果您正苦于以下问题:Python config.PORT属性的具体用法?Python config.PORT怎么用?Python config.PORT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在config的用法示例。


在下文中一共展示了config.PORT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: redis_get

# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def redis_get(rediskey):
    redis_statement="""for i in {{0..15}};do redis-cli -h {host} -p {port} -n ${{i}} keys '{rediskey}'|sed '/^$/d';done|while read j;do echo -e "\\"$j\\":"; for k in {{0..15}};do redis-cli -h {host} -p {port} -n ${{k}} get $j |sed '/^$/d'|awk '{{printf "\\"%s\\"",$1}}';done ;echo ',';done""".format(rediskey=rediskey,host=HOST, port=PORT)
    p = Popen(redis_statement, stdout=PIPE, shell=True)
    stdout, stderr = p.communicate()
    r = stdout.decode()
    r="".join(r.replace('\n',''))
    r=r.rstrip(",")
    r="{"+r+"}"
    return r 
开发者ID:bbotte,项目名称:bbotte.github.io,代码行数:11,代码来源:RedisSearch.py

示例2: run

# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def run(self):
		logging.getLogger('tornado.access').disabled = True # Disabling Tornado local logging
		ws_app = Application(self.agentQueue)
		server = tornado.httpserver.HTTPServer(ws_app)
		server.listen(config.PORT)
		
		tornado.ioloop.IOLoop.instance().start() 
开发者ID:Arno0x,项目名称:WSC2,代码行数:9,代码来源:websocketserver.py

示例3: welcome_page

# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def welcome_page():
    # TODO: Allow extending the current pause without unpausing
    c = rpyc.connect("localhost", PORT)
    if c.root.is_paused():
        return render_template("welcome_page_quiet.html",
                               resume=c.root.get_resume_time())
    else:
        return render_template("welcome_page.html") 
开发者ID:tpudlik,项目名称:hydroponics,代码行数:10,代码来源:webapp.py

示例4: pause_page

# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def pause_page():
    # TODO: Perform some type of validation of pause_duration?
    pause_duration = request.form["duration"]
    c = rpyc.connect("localhost", PORT)
    c.root.pause(pause_duration)
    return redirect(url_for('welcome_page')) 
开发者ID:tpudlik,项目名称:hydroponics,代码行数:8,代码来源:webapp.py

示例5: unpause_page

# 需要导入模块: import config [as 别名]
# 或者: from config import PORT [as 别名]
def unpause_page():
    c = rpyc.connect("localhost", PORT)
    c.root.resume()
    return redirect(url_for('welcome_page')) 
开发者ID:tpudlik,项目名称:hydroponics,代码行数:6,代码来源:webapp.py


注:本文中的config.PORT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。