Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

Text Manipulation and Printing

Hi,
Recently i came across a pretty cool printing technique that changes a specific word in a printed line without re printing the whole line again or clearing the console.
so u can use it for like counters or something like that. Does anyone know how to do that?

Thanks for the help
something like this?
for x in range(100000): print(f"{x}\r",end="")
🤣🤣🤣🤣🤣
Thank's man helped a lot!!!


But do u know a way that u can insert it into a line
so it would be like
print(f"Loading {x}\r Files...", end="")
(Jul 13, 2020 01:58 PM)HardStoN Wrote:  🤣🤣🤣🤣🤣
Thank's man helped a lot!!!


But do u know a way that u can insert it into a line
so it would be like
print(f"Loading {x}\r Files...", end="")

For a new line you can just add a new line you can add a new line using "\n", so it would look like the following:
Code
print(f"Loading {x}\r Files...", end="\n")

hi
What i mean is that if i do as i posted the output is:
https://imgur.com/a/y2aEXxl

Instead of Loading 9999 Files...

what i posted is:
for x in range(100000):
print(f"Loading {x}\r Files", end="")
(Jul 14, 2020 06:31 AM)HardStoN Wrote:  What i mean is that if i do as i posted the output is:
https://imgur.com/a/y2aEXxl

Instead of Loading 9999 Files...

what i posted is:
for x in range(100000):
   print(f"Loading {x}\r Files", end="")

Ah, I see what you mean. You can remove the "\r" and add it to the end, so it would look like:
Code
for x in range(1000000):
    print(f"Loading {x} Files", end="\r")

hi


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by Will PattersonSep 25, 2021 10:42 PM 4 168 Sep 25, 2021 10:42 PM
Last Post: Able.
[Java] by severosJun 5, 2021 06:30 PM 4 350 Jun 5, 2021 06:30 PM
Last Post: GenericSkid
[Python] by Mr.7Mar 1, 2019 03:09 AM 1 262 Mar 1, 2019 03:09 AM
Last Post: lockhead