Skip to content

Open text file in a separate file not in the terminal. #4067

@ritikag06

Description

@ritikag06

f= open("face.txt", mode= "wt", encoding= "utf-8")
f.writelines([' ______ \n/ \ \n| 0 0 | \n| * |\n\ v /\n ------ '])

f.close()

g= open("face.txt", "r")
print(g.read())

^^ That is my code and I am trying to open "face.txt" in a separate file but it keeps printing in the terminal. I am using Visual
Studio Code and I have python 3.9.0. Please help with some solutions. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions