V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  tmackan  ›  全部回复第 4 页 / 共 7 页
回复总数  138
1  2  3  4  5  6  7  
2020-09-18 18:36:57 +08:00
回复了 taomujian 创建的主题 Python 在 Python 文件运行的过程中怎么动态从外部加载数据?
你的使用场景描述不够清晰,如果输入是从 redis 获取的,那你可以去改变 redis 的数据
如果你是在程序中设置的 x=1,这种改成 x=2 ??不可能
2020-09-18 18:35:56 +08:00
回复了 taomujian 创建的主题 Python 在 Python 文件运行的过程中怎么动态从外部加载数据?
程序在不变的情况下,你要改变输出,只能改变输入啊
2020-03-09 17:35:05 +08:00
回复了 chengxiao 创建的主题 iDev 想学习 mac 应用开发,不知道着手点在哪里
性能利用率一直不超过 30%?? 你压测没到极限吧?
flask 多任务?flask 可以和 celery 结合

api 服务的话,一般都是
1.调 wsgi 配置
2.业务优化 比如增加缓存
3.加机器配置

py 高并发其实一般,qps1500 已经很多了
2019-12-26 20:08:48 +08:00
回复了 l4ever 创建的主题 Python flask_caching 之 memoize 谜团
class CacheProperty(object):
"""
Decorator that converts a method with a single self argument into a
property cached on the instance.

Optional ``name`` argument allows you to make cached properties of other
methods. (e.g. url = cached_property(get_absolute_url, name='url') )
"""
def __init__(self, func, name=None):
self.func = func
self.__doc__ = getattr(func, '__doc__')
self.name = name or func.__name__

def __get__(self, instance, type=None):
if instance is None:
return self
res = instance.__dict__[self.name] = self.func(instance)
return res

class A(object):
@CacheProperty
def create(self, id):
return
2019-12-26 09:53:19 +08:00
回复了 l4ever 创建的主题 Python flask_caching 之 memoize 谜团
def memoize(obj):
"""
Local cache of the function return value
"""
cache = obj.cache = {}

@functools.wraps(obj)
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in cache:
cache[key] = obj(*args, **kwargs)
return cache[key]
return memoizer
2019-12-26 09:53:04 +08:00
回复了 l4ever 创建的主题 Python flask_caching 之 memoize 谜团
```
def memoize(obj):
"""
Local cache of the function return value
"""
cache = obj.cache = {}

@functools.wraps(obj)
def memoizer(*args, **kwargs):
key = str(args) + str(kwargs)
if key not in cache:
cache[key] = obj(*args, **kwargs)
return cache[key]
return memoizer
```
2019-12-26 09:50:38 +08:00
回复了 l4ever 创建的主题 Python flask_caching 之 memoize 谜团
本地缓存都是根据参数,然后 hash 生成 redis 的 key,所以 self 这种场景不实用,参数不固定
2019-12-26 09:49:28 +08:00
回复了 l4ever 创建的主题 Python flask_caching 之 memoize 谜团
@timonwong 有道理
2019-12-25 19:06:07 +08:00
回复了 shawndev 创建的主题 程序员 有哪些值得推荐的开源团队知识管理系统?
@npe 这玩意跟 notion 比较像啊,但是比 notion 要方便很多,果断用了,个人用户还免费
2019-12-18 20:54:00 +08:00
回复了 magiclobster 创建的主题 程序员 D 大的都用什么软件来记录工作进度啊
@tmackan 额 记录任务 没有进度管理
2019-12-18 20:53:29 +08:00
回复了 magiclobster 创建的主题 程序员 D 大的都用什么软件来记录工作进度啊
things
2019-12-18 20:52:01 +08:00
回复了 HTSdTt3WygdgQQGe 创建的主题 Flask Flask 生产环境好难配置
@hoobyy hhhhhh
2019-12-13 18:13:30 +08:00
回复了 dennnis 创建的主题 程序员 做了 6 年 PHP ,想转 C++
@konakona 不好意思 少的可怜 py
2019-12-05 18:38:18 +08:00
回复了 Renco 创建的主题 程序员 关于开发过程中日志的问题
@jsjscool 不过日志脱敏 有必要哈 感谢
2019-12-05 18:35:36 +08:00
回复了 Renco 创建的主题 程序员 关于开发过程中日志的问题
@jsjscool
json 实际在 ternimal 里面不好看,只是 elk 的时候好处理而已,不到 grok
哎 sudo 以后就好了
2019-09-25 10:16:55 +08:00
回复了 hutusi 创建的主题 程序员 奔四大龄程序员,现在学数据结构和算法还来得及吗?
40 了 还第一线写代码?
2019-09-24 18:41:33 +08:00
回复了 Varobjs 创建的主题 程序员 接 Slack 的机器人 API 有感
接触过 Trello, zappier
zappier 简直牛逼,各个 app 上可以联动
2019-07-30 18:19:12 +08:00
回复了 tonslow 创建的主题 Java 你们的日志是怎么管理的?
elk
1  2  3  4  5  6  7  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1018 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 27ms · UTC 23:37 · PVG 07:37 · LAX 16:37 · JFK 19:37
Developed with CodeLauncher
♥ Do have faith in what you're doing.