I know similar questions have been asked before, however, I cannot edit my code to fit:
I have a python script that writes all combinations of 15 numbers in a txt file:
import itertools
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]
combinations = list(itertools.combinations(numbers, 15))
#print(combinations)
#Write combinations to a file
with open('combinations.txt', 'w') as f:
for comb in combinations:
f.write(str (comb) + 'n')
For some unknown reason, results come in parenthesis:
I need to write onto a xlsb file, each number in a column without parenthesis or commas, the expected result is below:
…with centralized text and fixed column width
Any ideas of a simple and small code? I already have pandas and openpyxl (if it helps)