V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  getlost  ›  全部回复第 2 页 / 共 3 页
回复总数  51
1  2  3  
2019-03-11 20:23:02 +08:00
回复了 getlost 创建的主题 LeetCode 同样的思路,计算时间确实别人的百倍
@hanbaobao2005 学习了,之前没了解过。我导入 timeit 模块,发现我的两个 for 循环占用的时间占总时间的 99%,不太明白为什么?
2019-03-11 12:40:37 +08:00
回复了 getlost 创建的主题 LeetCode 同样的思路,计算时间确实别人的百倍
@Gakho 我本地试的,同样的参数,他的就是比我快 100 倍,为啥还不知道
2019-03-10 22:24:37 +08:00
回复了 getlost 创建的主题 LeetCode 同样的思路,计算时间确实别人的百倍
@wallriding 第二段代码是耗时最短的解法,我参考他的解法来做了一次,但是存在疑问,因为用了同样的逻辑,耗时却差了 100 倍,我很疑惑,不知道哪里理解错了。
2019-03-10 22:04:39 +08:00
回复了 getlost 创建的主题 LeetCode 同样的思路,计算时间确实别人的百倍
@wallriding 刚开始练习,还需要努力学习
2019-03-10 21:36:01 +08:00
回复了 getlost 创建的主题 LeetCode 同样的思路,计算时间确实别人的百倍
2018-08-25 12:00:53 +08:00
回复了 getlost 创建的主题 问与答 mysql 安装出现问题
执行命令 mysqld -remove MySQL
安装路径中最好不要有中文
2018-08-09 11:17:53 +08:00
回复了 getlost 创建的主题 Django Django
@georgema1982 确实是这样,难道不允许修改嘛?
2018-08-09 11:16:56 +08:00
回复了 getlost 创建的主题 Django Django
@helloworld12 谢谢指教,form.is_valid()是 false
2018-07-23 21:37:22 +08:00
回复了 getlost 创建的主题 Python 在练习使用 Django,使用日期过滤器时遇到如下问题
@inoki 原来是 views 里面把变量名写错了
2018-07-22 23:47:55 +08:00
回复了 getlost 创建的主题 Python 在练习使用 Django,使用日期过滤器时遇到如下问题
@Zzdex @inoki 是我搞错了,没有迁移数据,但是还是有问题
----------------------------HTML---------------------------
{% extends "t_djangos/base.html" %}

{% block content %}

<p>Topics:{{ topic }}</p>

<p>Entries:</p>
<ul>
{% for entry in entries %}
<li>
<p>{{ entry.date_added|date:'M d, Y' H:i }}</p>
<p>{{ entry.text|linebreaks }}</p>
</li>
{% empty %}
<li>
There are no entriesfor this topic yet.
</li>
{% endfor %}
</ul>

{% endblock content %}
----------------------------HTML---------------------------
<p>{{ entry.date_added|date:'M d, Y' H:i }}</p> 这一行并不在网页上显示出来
<p>{{ entry.text|linebreaks }}</p> 这个却会
2018-07-22 22:37:54 +08:00
回复了 getlost 创建的主题 Python 在练习使用 Django,使用日期过滤器时遇到如下问题
@Zzdex @inoki 两位老哥思路是对的,但是我将 models.DateField 改为 models.DateTimeField 出现了新的错误,下面是报错
Internal Server Error: /topics/1/
Traceback (most recent call last):
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "d:\t_django\t_djangos\views.py", line 20, in topic
topic = Topic.objects.get(id=topic_id)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 397, in get
num = len(clone)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 254, in __len__
self._fetch_all()
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 1179, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 62, in __iter__
for row in compiler.results_iter(results):
File "d:\t_django\ll_env\lib\site-packages\django\db\models\sql\compiler.py", line 1011, in apply_converters
value = converter(value, expression, connection)
File "d:\t_django\ll_env\lib\site-packages\django\db\backends\sqlite3\operations.py", line 222, in convert_datetimefield_value
value = parse_datetime(value)
File "d:\t_django\ll_env\lib\site-packages\django\utils\dateparse.py", line 107, in parse_datetime
match = datetime_re.match(value)
TypeError: expected string or bytes-like object
[22/Jul/2018 22:33:12] "GET /topics/1/ HTTP/1.1" 500 101852
Internal Server Error: /topics/1/
Traceback (most recent call last):
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\exception.py", line 35, in inner
response = get_response(request)
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "d:\t_django\ll_env\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "d:\t_django\t_djangos\views.py", line 20, in topic
topic = Topic.objects.get(id=topic_id)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 397, in get
num = len(clone)
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 254, in __len__
self._fetch_all()
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 1179, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "d:\t_django\ll_env\lib\site-packages\django\db\models\query.py", line 62, in __iter__
for row in compiler.results_iter(results):
File "d:\t_django\ll_env\lib\site-packages\django\db\models\sql\compiler.py", line 1011, in apply_converters
value = converter(value, expression, connection)
File "d:\t_django\ll_env\lib\site-packages\django\db\backends\sqlite3\operations.py", line 222, in convert_datetimefield_value
value = parse_datetime(value)
File "d:\t_django\ll_env\lib\site-packages\django\utils\dateparse.py", line 107, in parse_datetime
match = datetime_re.match(value)
TypeError: expected string or bytes-like object
2018-07-22 22:34:50 +08:00
回复了 getlost 创建的主题 Python 在练习使用 Django,使用日期过滤器时遇到如下问题
@matrix1010 @chengxiao 谢谢各位老哥
@strive 在 cmd 里用吗?
@zyqf 之前装过乌班图,但是不会用,一直没法联网,又要忙着毕设就删了。毕业之后想学学 python
@omph 嗯,谢谢你,但是了解一点的就是 python 了,其他都不会。我去查查
@HuaBeau 嗯,就是按照这个装了 zip 的,但是没在备份文件里找到压缩的文件
@tennc 写好程序保存之后,在 cmd 里运行这个程序(我很白,以为在 pycharm 跑和 cmd 里不一样)
@yichinzhu 谢谢你,我按照作者的提示装了 zip
@Dvel 调皮

@fy
@zhihaofans 我试过几次了,我选择了 f 盘, f 里面出现了一些相关文件夹( Dlls,DOC...,),但是还是能在 c 盘上找到 python ( win10 系统里有个存储,里面能看安装在相应盘里的东西)
2016-09-08 22:28:55 +08:00
回复了 getlost 创建的主题 Python python 安装第三方库出问题
@TimePPT 还没用过,我试试
1  2  3  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5452 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 08:36 · PVG 16:36 · LAX 01:36 · JFK 04:36
Developed with CodeLauncher
♥ Do have faith in what you're doing.