Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print
#1
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)
Reply
#2
use f-strings and python 3.6 or newer:
print(f"{args.test1.strip()} {args.test2.strip()}:{args.test3.strip()}")
Reply
#3
Python 2.7 reaches end of life January 1 2020, so less than 2 months. Time to migrate.
Reply
#4
(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
Reply
#5
I haven't worked with antique python for so long that I wouldn't venture to say.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020