Python Forum
How to print message after row value in the same line
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to print message after row value in the same line
#1
Hi,
I am reading CSV files using readlines, and enumerate through columns. I print each row value, and some message.
print("INFO: " + f1_lines[i] + ":Fail")

but it printing ":Fail" in new line. How to print in the same line.
Reply
#2
Please show us the minimal lines of your code to reproduce the error.
Reply
#3
readlines returns lists on rows as strings with \n at the end.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with spliting line in print akbarza 3 335 Jan-23-2024, 04:11 PM
Last Post: deanhystad
  Print the line before the corrent line tester_V 9 1,489 Nov-18-2022, 08:39 AM
Last Post: Gribouillis
  Print to a New Line when Appending File DaveG 0 1,189 Mar-30-2022, 04:14 AM
Last Post: DaveG
  If match not found print last line tester_V 2 2,845 Apr-26-2021, 05:18 AM
Last Post: tester_V
  print a line break in writelines() method leodavinci1990 1 6,363 Oct-12-2020, 06:36 AM
Last Post: DeaD_EyE
  Print characters in a single line rather than one at a time hhydration 1 1,990 Oct-10-2020, 10:00 PM
Last Post: bowlofred
  How to print string multiple times on new line ace19887 7 5,573 Sep-30-2020, 02:53 PM
Last Post: buran
  Pattern Require Last Line Print() why? Harshil 4 2,375 Aug-08-2020, 04:54 PM
Last Post: Harshil
  print only last matched line tester_V 24 6,321 Apr-30-2020, 05:16 AM
Last Post: deanhystad
  item from a line to list however when i print the line instead of words i get letters Sutsro 5 2,895 Apr-22-2020, 02:39 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020