Reputation: 17
I am currently writing a Py script that uses
import os
newinput = raw_input(os.system("echo '\033[4;35m Hello \033[0m'")
But straight after that, I get this random zero And I can't seem to get rid of it
it looks like this
user@user$ Hello 0
How do I get rid of this?
Upvotes: 1
Views: 205
Reputation: 27333
Assuming you just want to have a colorful input, you can get rid of the os.system
call and just do:
newinput = raw_input("\033[4;35m Hello \033[0m")
Upvotes: 2
Reputation: 1787
You are calling raw_input
with the return value of os.system()
as its argument. echo
is returning an exit status of 0. raw_input
prints its argument, so it is printing 0.
Upvotes: 5