f.write redux

General discussion about topics related to OpenMV.
pcls1026
Posts: 19
Joined: Tue Aug 22, 2017 1:33 am

f.write redux

Postby pcls1026 » Thu Aug 31, 2017 7:04 pm

What should my f.write command look like to get an output file that looks like this:
123
456
789
etc.

instead of this:
123456789

JIM

I tried your suggestion, but it never worked.
Attachments
helloworld_single.py
(604 Bytes) Downloaded 8 times
User avatar
kwagyeman
Posts: 1246
Joined: Sun May 24, 2015 2:10 pm

Re: f.write redux

Postby kwagyeman » Fri Sep 01, 2017 1:52 am

Do:

Code: Select all

f.write(s + '\r\n')
The \r\n part is called a newline. On linux you just need \n. On windows you need both.

Note that this is a regular python problem. For these types of questions you can easily google for the solution. I'll answer, but, you'll be able to find what you need faster for things that sound like they are regular python problems.
Nyamekye,
pcls1026
Posts: 19
Joined: Tue Aug 22, 2017 1:33 am

Re: f.write redux

Postby pcls1026 » Fri Sep 01, 2017 11:07 am

Thanks for the help. Where do you find the time for noobies like me??
Regards
Jim Sullivan
User avatar
kwagyeman
Posts: 1246
Joined: Sun May 24, 2015 2:10 pm

Re: f.write redux

Postby kwagyeman » Fri Sep 01, 2017 7:54 pm

I just try to answer all questions. :)
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: Google [Bot] and 1 guest