Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (47.6k points)

I want to run a script, which basically shows things like:

Installing XXX... [DONE]

Now, at the moment, I use print to print the whole line AFTER the function has succeeded. However, I now want it to print "Installing xxx..." first, and AFTER the function has run, to add the "DONE" tag, but on the same line.

Any ideas?

1 Answer

0 votes
by (106k points)

In Python, for multiple prints in one-line, you can use the print statement to do this without importing sys. See the code below:-

def install_xxx():

print "Installing XXX... ",

install_xxx()

print "[DONE]"

To know more about this you can have a look at the following video tutorial:-

Related questions

0 votes
1 answer
0 votes
1 answer
asked Sep 25, 2019 in Python by Sammy (47.6k points)
0 votes
1 answer
asked Jul 26, 2019 in Python by selena (1.6k points)
0 votes
1 answer
0 votes
1 answer

Browse Categories

...