A
A
andrey_ado2015-06-17 21:40:51
Python
andrey_ado, 2015-06-17 21:40:51

Incorrect work of Sublime Text 3 and Python3. How to win?

I have been writing in Sublime for a long time, then I came across the following:

def test_button_event(self):
        item_list = []
        for i in self.tree.get_children():
            #print(i)
            #print(self.tree.item(i, 'values'))
            item_list.append(list(self.tree.item(i, 'values')))
        print(item_list)
        # print('foo')

This is the code for the button click handler "Test", Tkinter GUI, which displays various information that I need on click.
In this case, the code lists the values ​​of the ttk.Treeview elements.
All this is output. if you run the script from the command line or in PyCharm, but through Ctrl + B in ST3 the console is empty.
If you insert something like print('foo'), the output occurs, but the list is not displayed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andrey_ado, 2015-06-18
@andrey_ado

The output to the console did not work because of the Cyrillic alphabet in the output list.
Added to sublime-build "env": {"PYTHONIOENCODING": "UTF-8"}
Now it all looks like this:

{
   "cmd": "c:/Python34/python.exe -u \"$file\"",
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",
    "env": {"PYTHONIOENCODING": "UTF-8"}  
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question