Python - how to write strings to file without quotes and spaces?

Viewed 28969

Is it possible to write into file string without quotes and spaces (spaces for any type in list)?

For example I have such list:

['blabla', 10, 'something']

How can I write into file so line in a file would become like:

blabla,10,something

Now every time I write it into file I get this:

'blabla', 10, 'something'

So then I need to replace ' and ' ' with empty symbol. Maybe there is some trick, so I shouldn't need to replace it all the time?

3 Answers
Related