Jump to content

Python how to write on the next line

Wictorian
Go to solution Solved by Wictorian,
Just now, Wictorian said:

open("app locations.py", "a+").write(input(),"\n")

this runs but doesnt write

I figured it out now. I should use + instead of ,

So I am writing things to  a .py file using this code

,

open("app locations.py", "a+").write(input())

but it writes right next to each other. I want it to write on the next line

how do I do that?

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Wictorian said:

So I am writing things to  a .py file using this code

,


open("app locations.py", "a+").write(input())

but it writes right next to each other. I want it to write on the next line

how do I do that?

\n

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, jaslion said:

\n

yeah I know it but where should I put it?

(I tried it but didnt work)

Link to comment
Share on other sites

Link to post
Share on other sites

open("app locations.py", "a+").write(input(),"\n")

this runs but doesnt write

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Wictorian said:

open("app locations.py", "a+").write(input(),"\n")

this runs but doesnt write

I figured it out now. I should use + instead of ,

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×