Ask your own question, for FREE!
Computer Science 8 Online
OpenStudy (blackstreet23):

How do i use the "\r" or carriage return in python? Can somebody give me an example?

OpenStudy (p0sitr0n):

it replaces the current line print foo print bar \r result: bar

OpenStudy (rsmith6559):

Pedantically, when you're outputting HTML from a script you must output a Content-type line. The w3 spec actually requires a carriage return/linefeed ( ala Microsoft ). print "Content-type: text/html\r\n" I've never had a problem outputting just a linefeed. But hey, it was a useful example to answer your question!

OpenStudy (blackstreet23):

P0sitr0n i tried to use it like that in python, but it didnt work :(

OpenStudy (rsmith6559):

There are two places that I know of that still use carriage returns: inside GUIs on Macs, and in combination with linefeeds (CR/LF) in Windows. If you use a carriage return in Unix, and OSX's Unix parts, it will show as "^M".

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!