Reputation: 3
I want to strip platform.linux_distribution()
.
Output is tuple ('Ubuntu', '11.10', 'oneiric')
but I want to show it as "Ubuntu 11.10 oneriric"
.group(1)
is not working.
Upvotes: 0
Views: 251
Reputation: 104080
You're looking for " ".join()
:
>>> import platform
>>> platform.linux_distribution()
('Ubuntu', '11.04', 'natty')
>>> " ".join(platform.linux_distribution())
'Ubuntu 11.04 natty'
>>>
Upvotes: 4
Reputation: 7336
how about:
' '.join(platform.linux_distribution())
I'm on a mac, so I don't have platform.linux_distribution()
, but it looks like it should return an array.
Upvotes: 0