V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  owenliang  ›  全部回复第 10 页 / 共 32 页
回复总数  629
1 ... 6  7  8  9  10  11  12  13  14  15 ... 32  
main.py


# -*- coding: utf-8 -*-

import sys
import time

plugin_util = __import__("plugins.util", globals(), locals(), 'util')


plugins/util.py

import sys

g_vars = globals()

for name in sys.modules:
g_vars[name] = sys.modules[name]

print(time.clock())

你是指这个意思吗?把 sys 中的 modules 展开到 plugin 的全局变量里?
某些原因到底是啥原因
2018-08-27 18:04:08 +08:00
回复了 baiman521 创建的主题 Python API 接口开发 Python 和 PHP 哪个更合适?
无论哪个语言吧,都得找一个 MVC 框架,在官网的看入门教程,这得花费你 1-2 小时的时间。

看完框架入门教程,一般是教你 ORM 操作数据库,你可能还得查一下缓存怎么用,再就是如何不用 ORM 直接写 SQL,这样就飞起来了。
@alwayshere boost mode 呀,不做乘法怎么打压,1 加 0.1 才 1.1,1*0.1 是 0.1。
得用 multiple 吧,和相关性做 sum 有啥用,量级都不同。
2018-08-26 11:37:50 +08:00
回复了 swordspoet 创建的主题 程序员 最近压力好大
知错就改善莫大焉
2018-08-24 17:29:54 +08:00
回复了 xiaoyanbot 创建的主题 MySQL 为什么 mysql 的 timestamp 字段允许录入 0000-00-00 00:00:00
的确是智障,我这两天 mysql 数据同步 ES,因为这个问题挂逼了。
2018-08-24 17:09:48 +08:00
回复了 tedeyang 创建的主题 Python Python 这语言真是混乱和原始
最早 python 是很好的,后来就不遵守自己的哲学了。

>>> import this
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
2018-08-24 17:08:32 +08:00
回复了 wangxiaoaer 创建的主题 Ubuntu windows:你大爷终究还是你大爷
windows 就是缺个 linux server 环境做开发,为何要用 linux 桌面。
找运维给你搞个负载均衡就好了。
2018-08-24 13:11:25 +08:00
回复了 tedeyang 创建的主题 Python Python 这语言真是混乱和原始
asyncio 堪称经典
微博被点赞是微博的属性,你是否点赞是你的属性,两码事吧
2018-08-15 15:42:46 +08:00
回复了 e583409 创建的主题 Redis redis cluster 还是 codis 呢?
@rrfeng 例如 php,django 等,都是短链接。
2018-08-15 15:39:34 +08:00
回复了 e583409 创建的主题 Redis redis cluster 还是 codis 呢?
长连接 cluster,短链接 codis
2018-08-10 08:06:54 +08:00
回复了 bestkayle 创建的主题 PHP 《 PHP 7 底层设计与源码实现》这本书怎么样,有人看过吗
对,看你的目的是什么。
我还以为你在说我的老板!
2018-08-07 19:17:54 +08:00
回复了 alamaya 创建的主题 程序员 求助大表优化方案
@alamaya 不是 mongo 旁路了吗,是个分布式存储
2018-08-07 16:52:03 +08:00
回复了 alamaya 创建的主题 程序员 求助大表优化方案
@alamaya 性能问题优先 redis 缓存热点,其次考虑 mysql 分表内走索引或者 mongodb 走索引,es 不适合那么高性能。
2018-08-07 16:26:28 +08:00
回复了 alamaya 创建的主题 程序员 求助大表优化方案
按用户分 mysql。

然后数据打到 ES/Mongo 中做旁路。
2018-08-06 19:43:39 +08:00
回复了 imherer 创建的主题 程序员 问一个 Nginx 做负载均衡容灾(单点故障)问题
自建就是 keepalive 了
1 ... 6  7  8  9  10  11  12  13  14  15 ... 32  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3683 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 33ms · UTC 10:44 · PVG 18:44 · LAX 03:44 · JFK 06:44
Developed with CodeLauncher
♥ Do have faith in what you're doing.