lailongmen's recent timeline updates
lailongmen

lailongmen

V2EX member #162374, joined on 2016-03-08 12:18:24 +08:00
lailongmen's recent replies
@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()
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   783 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 20:41 · PVG 04:41 · LAX 13:41 · JFK 16:41
♥ Do have faith in what you're doing.