Continue writing in same line of file

后端 未结 3 1565
难免孤独
难免孤独 2020-12-17 01:57

I have opened the file I want to write to using:

data = open(\'input\',\'a\')

using a loop, I want to write some words to the file in the s

3条回答
  •  借酒劲吻你
    2020-12-17 02:21

    while loop:
    for loop:
        /*do something
        */
        if some_condition:
            data.write(str(tag)+"")
    data.write(" ")
    

    In other words, remove the data.write("\n");

提交回复
热议问题