Closed StewAlexander-com closed 4 years ago
Yeah, I get the same thing here...
It prints "hello" (in red), then "none"
#!/usr/bin/env python3
# Import colors from termcolor
from termcolor import *
#import colorama to print colors to Windows systems
import colorama
colorama.init()
hello = cprint("hello", 'red')
print(hello)
Hi there! This doesn't seem to be related to colorama. The issue exists even without importing and initializing colorama.
Apparently, "cprint" is a function that already prints, so the call to cprint("hello", 'red')
prints the red "hello", and the print of the variable, hello
, which is assigned the return value of the function cprint
(None
) will print "None". Just skip the second "print" and you'll be good.
Hi,
I created a prompt (was using termcolor "colored" function, but didn't work with Windows)
Then I tried calling it in a function:
StartNum = float(input(prmpt_magenta))
The script compiles in Geany, but when execute the program I get the word "none"
Ideas?