0

I have a python tuple that contains items such as:

kone = ('ice_cream', 'sprinkles', 'toppings', 'nuts', 'cherries')

I'm trying to add that tuple to a command line call but the formatting is off. My current code looks like:

subprocess.popen("python", str(kone))

but will call this

 ('python',"('ice_cream', 'sprinkles', 'toppings', 'nuts', 'cherries')")

How can I edit my code so it returns just the content within "kone" instead:

 ('python','ice_cream', 'sprinkles', 'toppings', 'nuts', 'cherries')
John Wick
  • 387
  • 1
  • 2
  • 8

1 Answers1

0

You can do:

subprocess.popen(("python",) + kone)
rodgdor
  • 2,530
  • 1
  • 19
  • 26