Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print not printing newlines
#3
I tried this: print('Received',data.decode('utf-8') )

This works on 3.3 but not on 2.7.


In Python, is there a way to do something like this, which I could do in C code:
#ifdef version 3.3
doit this way
#else
that way
#endif

So, is there a way, other than supplying two sets of code to do this?
Reply


Messages In This Thread
print not printing newlines - by rocket777 - Jul-02-2021, 11:49 PM
RE: print not printing newlines - by deanhystad - Jul-03-2021, 03:16 AM
RE: print not printing newlines - by rocket777 - Jul-03-2021, 04:46 PM
RE: print not printing newlines - by ibreeden - Jul-03-2021, 05:35 PM
RE: print not printing newlines - by bowlofred - Jul-03-2021, 09:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  printing a list contents without brackets in a print statement paracelx 1 2,182 Feb-15-2020, 02:15 AM
Last Post: Larz60+
  Printing output without print usage susmith552 1 1,720 Feb-07-2020, 07:52 PM
Last Post: Clunk_Head
  strip off just newlines Skaperen 11 5,514 Jun-19-2019, 06:28 PM
Last Post: Skaperen
  Print Not Printing Correctly kittylexi 3 3,365 Sep-11-2018, 04:38 AM
Last Post: Larz60+
  Search & Replace - Newlines Added After Replace dj99 3 3,475 Jul-22-2018, 01:42 PM
Last Post: buran

Forum Jump:

User Panel Messages

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