lailongmen 最近的时间轴更新
lailongmen

lailongmen

V2EX 第 162374 号会员,加入于 2016-03-08 12:18:24 +08:00
lailongmen 最近回复了
@hubqin 谢谢!可以了。

@xpresslink 你这个方法不行啊。我是新手在看教学,只会这个办法。
教学里面是固定内容,比如:re.findall(r"hi", text)
感觉那样太死板,所以自己改成变量。
@maxoxo 谢谢,刚测试了,你这个方式也可以。
@manzhiyong 谢谢,搞定了。py3 也支持
@janxin 我看了这个文档,是说 w+读写都可以? http://www.runoob.com/python/python-func-open.html
而且就算我改成 r+,也还是无效。

f = open('C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python36-32\\my\\game.txt', 'r+')
score1=f.read()
f.close()
if score1==bool(False):
f = open('C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python36-32\\my\\game.txt', 'w+')
f.write('0 0 0')
f.close()
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   943 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 20:49 · PVG 04:49 · LAX 13:49 · JFK 16:49
Developed with CodeLauncher
♥ Do have faith in what you're doing.