print() without newline

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ik8vrq
Posts: 4
Joined: Wed Nov 26, 2014 9:46 am

print() without newline

Post by ik8vrq » Sat Jan 17, 2015 2:15 pm

Hello,

I need to use print function without generating a newline. It seems to me that using "," after print function does not works:

print ("ABC"),
print ("DEF")
The result:
ABC
DEF

with:
sys.stdout.write("ABC")

I have: ABC3

????


Any advice?

Thank you.

Angelo IK8VRQ

pfalcon
Posts: 1155
Joined: Fri Feb 28, 2014 2:05 pm

Re: print() without newline

Post by pfalcon » Sat Jan 17, 2015 4:31 pm

Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/

ik8vrq
Posts: 4
Joined: Wed Nov 26, 2014 9:46 am

Re: print() without newline

Post by ik8vrq » Sat Jan 17, 2015 6:36 pm

Many thanks!!!
You are right!!!

Sorry.

Angelo IK8VRQ
Last edited by ik8vrq on Sat Jan 17, 2015 6:37 pm, edited 1 time in total.

chc8
Posts: 1
Joined: Sun Aug 21, 2022 3:57 am

Re: print() without newline

Post by chc8 » Sun Aug 21, 2022 3:58 am

Try using the end parameter:

For example: print(".",end="")

Post Reply