Sublime Text 3 does not print correctly

I have the following code:

if __name__ == '__main__':
    player_information = get_information()
    print "Goalkeepers top 10:"
    goalkeepers = get_position(player_information, "Goalkeeper")
    for player, points in get_top_players(goalkeepers, 10, 5):
        print goalkeepers[player]["name"], points

    print "\nDefenders top 10:"
    defenders = get_position(player_information, "Defender")
    for player, points in get_top_players(defenders, 10, 5):
        print defenders[player]["name"], points

    print "\nMidfielders top 10:"
    midfielders = get_position(player_information, "Midfielder")
    for player, points in get_top_players(midfielders, 10, 5):
        print midfielders[player]["name"], points

    print "\nForwards top 10:"
    forwards = get_position(player_information, "Forward")
    for player, points in get_top_players(forwards, 10, 5):
        print forwards[player]["name"], points

The output when used Ctrl + Bin Sublime Text 3 (I already selected Pythonafter clicking Ctrl + Shift + B).

Goalkeepers top 10:
de Gea 33
Ryan 23
Schmeichel 23
Lössl 22
Ederson 22
Pope 22
Forster 21
Mignolet 21
Hart 20
Courtois 19

Defenders top 10:
Monreal 32
Jones 32
Azpilicueta 30
Trippier 29
Kolasinac 28
Otamendi 27
Fuchs 24
Bellerín 23
Ward 23
Valencia 23

Midfielders top 10:
Ramsey 30
Coutinho 28
Richarlison 28
Mahrez 27
Fernandinho 27
Eriksen 27
David Silva 26

Forwards top 10:
Kane 44
Abraham 30
Diouf 28
Lacazette 25
Lukaku 25
Morata 24
Murray 22
Rashford 21
Jesus 20
Niasse 20

For some reason, the Midfielder bit does not print correctly (only 7 out of 10 players print). However, when launched from a file from the terminal, it is completely printed, as shown below:

Goalkeepers top 10:
de Gea 33
Ryan 23
Schmeichel 23
Lössl 22
Ederson 22
Pope 22
Forster 21
Mignolet 21
Hart 20
Courtois 19

Defenders top 10:
Monreal 32
Jones 32
Azpilicueta 30
Trippier 29
Kolasinac 28
Otamendi 27
Fuchs 24
Bellerín 23
Ward 23
Valencia 23

Midfielders top 10:
Sané 53
Sterling 38
De Bruyne 31
Ramsey 30
Coutinho 28
Richarlison 28
Mahrez 27
Fernandinho 27
Eriksen 27
David Silva 26

Forwards top 10:
Kane 44
Abraham 30
Diouf 28
Lacazette 25
Lukaku 25
Morata 24
Murray 22
Rashford 21
Jesus 20
Niasse 20

Just printing the dots leads to the fact that the output of Sublime Text 3 is the same, so I thought that maybe this is something related to the encoding, but it does not change anything.

0
source share

Source: https://habr.com/ru/post/1687933/


All Articles