简体   繁体   English

我的脚本中的Python语法错误

[英]An Python syntax error in my script

text = open(name + ".txt", "w")  

text.write(con_person + "\n" + con_key_words_list+ "\n" + con_person_rand + "\n" + con_person_rev_rand + "\n" + con_person_up_rand + "\n" + con_person_up_rev_rand + "\n" + con_key_words_list_rand + "\n" + con_key_words_list_rev_rand + "\n" + con_per_per + "\n" + con_per_perrev + "\n" + con_per_perup + "\n" + con_per_kw + "\n" + con_per_kwr + "\n" + con_per_brith02 + "\n" + con_per_brith04 + "\n" + con_per_brith06 + "\n" + con_per_brith68 + "\n" + con_per_rev_brith02 + "\n" + con_per_rev_brith04 + "\n" + con_per_rev_brith06 + "\n" + con_per_rev_brith68 + "\n" con_kw_per + "\n" + con_kw_per_rev + "\n" + con_kw_per_up + "\n" + con_kw_per_up_rev + "\n" + con_kw_kw + "\n" + con_kw_kwr + "\n" + con_kw_brith02 + "\n" + con_kw_brith04 + "\n" + con_kw_brith06 + "\n" + con_kw_brith68 + "\n" + con_kwr_kwr + "\n" + con_kwr_kw + "\n" + con_kwr_brith02 + "\n" + con_kwr_brith04 + "\n" + con_kwr_brith06 + "\n" + con_kwr_brith68)

text.close()

E0001:invalid syntax (, line 259) I don't see anything wrong in this line please help. E0001:语法无效(第259行)我没有看到这行有什么问题,请帮忙。

con_per_rev_brith68 + "\n" con_kw_per + "\n" +

to

con_per_rev_brith68 + "\n" + con_kw_per + "\n" +

When writing your code in long lines it makes it hard to catch things like this aswell 当长时间编写代码时,也很难捕捉到这种情况

Ex: 例如:

    con_per_rev_brith04 + "\n" + 
    con_per_rev_brith06 + "\n" + 
    con_per_rev_brith68 + "\n" 
    con_kw_per + "\n" + 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM