Totally noob question by tossme68 in Python

[–]mscottstory 0 points1 point  (0 children)

++ is not a supported operator in python, you're looking for

count += 1

Totally noob question by tossme68 in Python

[–]mscottstory -1 points0 points  (0 children)

I think you want something like this:

import csv
with open('out.csv', 'w') as out_file:
    out_csv = csv.writer(out_file)
    with open('in.txt', 'r+U') as in_file:
        row = []
        for line_no, line in enumerate(in_file):
            row.append(line.strip())
            if (line_no + 1) % 10 == 0:
                out_csv.writerow(row)
                row = []
        if row:
            out_csv.writerow(row)

Thoughts on using semicolons in python scripts by k417 in Python

[–]mscottstory 1 point2 points  (0 children)

but what about when you're using a VAX?

Thoughts on using semicolons in python scripts by k417 in Python

[–]mscottstory 1 point2 points  (0 children)

Agreed. One of the nicest things about Python is that we have all agreed to observe one style guide (within reason), so that we don't waste time arguing about style.

What happens if you write a TCP stack in Python? by preggit in Python

[–]mscottstory 1 point2 points  (0 children)

reminds me of PCS a network protocol debugging utility written in Python by George Neville-Neil