Try str.join
:
file2.write(' '.join(buffer))
Documentation says:
Return a string which is the concatenation of the strings in the iterable iterable. The separator between elements is the string providing this method.
More Related Contents:
- Static methods in Python?
- urllib and “SSL: CERTIFICATE_VERIFY_FAILED” Error
- Finding and replacing elements in a list
- How to truncate float values?
- Execution of Python code with -m option or not
- Python script to do something at the same time every day [duplicate]
- Pandas: How to easily share a sample dataframe using df.to_dict()?
- Purpose of calling function without brackets python
- Cannot concatenate ‘str’ and ‘float’ objects?
- Python: simple list merging based on intersections
- No module named ‘pandas._libs.tslibs.timedeltas’ in PyInstaller
- Python/BeautifulSoup – how to remove all tags from an element?
- Python: tf-idf-cosine: to find document similarity
- How can I assign the value of a variable using eval in python?
- PicklingError: Can’t pickle : it’s not the same object as decimal.Decimal
- Using BeautifulSoup to search HTML for string
- multiple databases and multiple models in django
- How can I save a Librosa spectrogram plot as a specific sized image?
- How to print double quotes around a variable?
- Install libxml2 and associated python bindings – Windows
- AttributeError: partially initialized module ‘turtle’ has no attribute ‘Turtle’ (most likely due to a circular import)
- How to parse somewhat wrong JSON with Python?
- python 3 open() default encoding
- How can I simulate 2.x’s tuple unpacking for lambda parameters, using 3.x?
- What is the pythonic way to unpack tuples as function arguments? [duplicate]
- Module function vs staticmethod vs classmethod vs no decorators: Which idiom is more pythonic?
- Are Generators Threadsafe?
- Detect whether Celery is Available/Running
- How to implement a Lock with a timeout in Python 2.7
- Python cos(90) and cos(270) not 0