Sublime Text 3无法正确打印

时间:2017-10-30 16:40:38

标签: python python-2.7 sublimetext3

我有以下代码:

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

在Sublime Text 3上使用Ctrl + B时的输出(我在点击Python后选择了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

出于某种原因,中场位没有正确打印(仅打印10个玩家中的7个)。但是,当从终端从文件运行时,它打印完全正常,如下所示:

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

只是打印点确实导致Sublime Text 3输出相同,所以我想也许它与编码有关,但这并没有改变一件事。

0 个答案:

没有答案