Python Forum

Full Version: print
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi
any one can help

print args.test1, args.test2,':', args.test3
im getting this output: value value : value but need: value value:value

python 2.7

(Nov-06-2019, 11:18 AM)mar24nn Wrote: [ -> ]hi
any one can help

print args.test1, args.test2,':', args.test3
im getting this output: value value : value but need: value value:value

python 2.7


s = ':'
seq = args.test2, args.test3

print args.test1, s.join(seq)
use f-strings and python 3.6 or newer:
print(f"{args.test1.strip()} {args.test2.strip()}:{args.test3.strip()}")
Python 2.7 reaches end of life January 1 2020, so less than 2 months. Time to migrate.
(Nov-06-2019, 05:48 PM)Larz60+ Wrote: [ -> ]use f-strings and python 3.6 or newer:
print(f"{args.test1.strip()} {args.test2.strip()}:{args.test3.strip()}")

thx for that , but i need to be stack to phantom2 for a month yet , i have solved this already , but got another issue

how can i print to text file error like this from my app.py:

app.py: error: too few arguments
I haven't worked with antique python for so long that I wouldn't venture to say.