Василь Коломієць added the comment:

I am very happy!
Thx for attention to my opinion.
Sorry for my english.

so - in attachment two codes and source csv-file.

With best wishes,
Vasyl Kolomiets.
+38050 45 22 559

2016-01-15 0:38 GMT+02:00 Georg Brandl <rep...@bugs.python.org>:

>
> Georg Brandl added the comment:
>
> We'll need at least the two full examples (one not working, one working)
> to make a call here.
>
> ----------
> nosy: +georg.brandl
>
> _______________________________________
> Python tracker <rep...@bugs.python.org>
> <http://bugs.python.org/issue26116>
> _______________________________________
>

----------
Added file: http://bugs.python.org/file41617/may_be-error_csv_exmpl.py
Added file: http://bugs.python.org/file41618/from_to_proportions.csv
Added file: http://bugs.python.org/file41619/may_be-good_csv_exmpl.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26116>
_______________________________________
from tkinter import *
from PIL import Image
import csv

filename = "from_to_proportions.csv"
with open(filename) as csvfile:
    dialect=csv.Sniffer().sniff(csvfile.read(1024))
    csvfile.seek(0)
    print(dialect)
    readed = csv.DictReader(csvfile, dialect)
    for row in readed:
        print(row)
        print (row["from_id"],row["from_name"],row['to_id'],row['to_name'],
               row['barcodes_percentage'],row['rows_to_be'])
        
from_id;from_name;to_id;to_name;barcodes_percentage;rows_to_be
1;Київ;2;Дніпро;75%;4
1;Київ;3;Запоріжжя;10%;4
1;Київ;4;Одеса;15%;4
1;Київ;5;Львів;0%;4
2;Дніпро;1;Київ;50%;4
2;Дніпро;3;Запоріжжя;10%;4
2;Дніпро;4;Одеса;25%;4
2;Дніпро;5;Львів;15%;4
3;Запоріжжя;1;Київ;0%;4
3;Запоріжжя;2;Дніпро;33%;4
3;Запоріжжя;4;Одеса;33%;4
3;Запоріжжя;5;Львів;34%;4
4;Одеса;1;Київ;25%;4
4;Одеса;2;Дніпро;25%;4
4;Одеса;3;Запоріжжя;25%;4
4;Одеса;5;Львів;25%;4
5;Львів;1;Київ;0%;4
5;Львів;2;Дніпро;50%;4
5;Львів;3;Запоріжжя;15%;4
5;Львів;4;Одеса;35%;4
from tkinter import *
from PIL import Image
import csv

filename = "from_to_proportions.csv"
with open(filename) as csvfile:
    dialect=csv.Sniffer().sniff(csvfile.read(1024))
    csvfile.seek(0)
    print(dialect)
    readed = csv.DictReader(csvfile, dialect=dialect)
    for row in readed:
        print(row)
        print (row["from_id"],row["from_name"],row['to_id'],row['to_name'],
               row['barcodes_percentage'],row['rows_to_be'])
        
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to