登录
首页 » python » python、session

python、session

于 2022-03-07 发布 文件大小:1.08 kB
0 90
下载积分: 2 下载次数: 1

代码说明:

#!/usr/bin/env python# -*- coding: utf-8 -*-import webweb.config.debug = Falseurls = (    "/count", "count",    "/reset", "reset")app = web.application(urls, locals())session = web.session.Session(app, web.session.DiskStore("sessions"), initializer={"count": 0})class count:    def GET(self):        session.count += 1        return str(session.count)class reset:    def GET(self):        session.kill()        return ""if __name__ == "__main__":    app.run()

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • ArcGIS的Python脚本编程
    地理信息系统应用,面向ArcGIS的Python脚本编程(Geographic Information System Application, Python Script Programming for ArcGIS)
    2020-11-26 17:29:31下载
    积分:1
  • 从Python开始学编程
    说明:  本书以Python为样本,不仅介绍了编程的基本概念,还着重讲解了 编程语言的范式(面向过程、面向对象、面向函数),并把编程语言的 范式糅在Python中,让读者不仅学会Python,未来在学习其他编程语言 时也变得更加容易。(aking Python as a sample, this book not only introduces the basic concepts of programming, but also focuses on the programming language paradigm (process-oriented, object-oriented, function-oriented), and incorporates the programming language paradigm into Python, so that readers can not only learn Python, but also become easier to learn other programming languages in the future.)
    2020-06-18 03:00:02下载
    积分:1
  • OpenCV官方教程中文版(For Python)
    官方出版的opencv教程,学习opencv必备。(Officially published opencv tutorials are essential for learning.)
    2020-06-24 03:00:02下载
    积分:1
  • 健康照护的简单前端制作
    基于Django框架的前端制作,运用了MySQL数据库的数据增删改查,适用于小白对django框架的理解
    2022-03-06 12:31:03下载
    积分:1
  • Residual-Networks
    残差神经网络的Python实现,用于机器学习的图像识别方向。(Python implement on Residual Network)
    2018-05-19 19:04:04下载
    积分:1
  • 俄罗斯方块强化学习实验报告
    一、俄罗斯方块DQN算法实验报告1. 网络结构图1 DQN网络结构2. 超参数 GAMMA = 0.99  # decay rate of past observations 设置增强学习更新公式中的累计折扣因子 OBSERVE = 500.  # timesteps to observe before training 设置观察期的迭代次数 EXPLORE = 500.  # frames over which to anneal epsilon 设置探索期的观察次数 FINAL_EPSILON = 0.002  # final value of epsilon 设置ε的最终最小值 INITIAL_EPSILON = 10.0  # starting value of epsilon 设置ε的初始值 REPLAY_MEMORY = 5900  # number of previous transitions to remember 设置replay memory的容量 BATCH = 32  # size of mini batch 设置每次网络参数更新世用的样本数目 K = 1  # only select an action every Kth frame, repeat prev for others,设置几帧图像进行一次动作, # K越大让控制台输出的速度变慢,游戏画面速度变快,机器人动作的速度变越迟缓。ACTIONS = 6  # number of valid actions 游戏动作数3.实验结果训练前期的self.score分数很低150左右,EPSILON=1.0,Q_MAX= 2.061341e-02:图2 EPSILON=1.0设置超参数EPSILON=0.05在1000步迭代之后:EPSILON固定在0.04999999999999416  Q_MAX = -1.163765e-01Self.score有明显的提升,但是之后无论训练多久都没有明显提升了。图3 EPSILON=0.05设置超参数EPSILON= 0.002在1001步迭代之后:EPSILON固定在0.000004 Q_MAX = 1.728995e 02Self.score可以轻松达到200以上。图4 EPSILON=0.000004设置超参数EPSILON= 0.000001在1001步迭代之后:EPSILON固定在-0.001998997999987482  Q_MAX = 1.899879e 03Self.score可以轻松达到200以上。图5 EPSILON=-0.002 【核心代码】用DQN来玩俄罗斯方块 tetrix_DQN ├── Wrapped Game Code│   └── tetris_fun.py├── deep_q_network.py├── logs_tetris│   ├── hidden.txt│   └── readout.txt└── saved_networks    ├── tetris-dqn-10000.data-00000-of-00001    ├── tetris-dqn-10000.index    ├── tetris-dqn-10000.meta    └── tetris-dqn-316600003 directories, 8 files
    2020-12-01下载
    积分:1
  • PyLED-master
    说明:  py语言led控制操作代码,第三方工具。(Py language LED control operation code, third-party tools.)
    2019-05-26 20:45:25下载
    积分:1
  • strain-stress-curve
    读取abaqus结果文件odb中的内容,并存储到文件中。有助于快速查看结果。提高效率(Abaqus results file odb is read and stored in the file. Help you quickly see the results. Improve efficiency)
    2021-03-10 08:39:27下载
    积分:1
  • CollaborationNetwork
    构建了无向加权网,并对网络的度分布、集聚系数、最短路径、度匹配度、度中心性等重要参数进行了计算,在此基础上构建了社区挖掘算法用于网络的社区发现,并采用链路预测算法构建推荐系统(An undirected weighted network is constructed, and some important parameters, such as degree distribution, aggregation coefficient, shortest path, degree matching degree and degree centrality, are calculated. On this basis, a community discovery algorithm is built for the network, and a link prediction algorithm is used to construct a recommendation system.)
    2018-05-15 09:12:54下载
    积分:1
  • StockPricePrediction-master
    说明:  python深度学习股票分析框架,就这么多了(python learning stock)
    2019-06-18 12:19:59下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载