1

I want to display currencies using a really simple python script:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import logging

if __name__ == '__main__':
    print('€')

On my local computer, everything works fine when I run the script with powershell.

If I run the same script on my Windows Server 2008 however, the output is a question mark (?).

I tried all solutions from this answer without success: https://stackoverflow.com/a/39936499/4437149.

Since im new to python I cant figure out whats exactly wrong.

Is there something missing in my script or any server misconfiguration? Im using the newest version of python (currently 3.8.0).

Marlon
  • 197
  • 2
  • 16

1 Answers1

1

Update:

Setting the terminal font to "Lucida Console" seems to be the solution.


Old Answer:

On windows, you may want to use an escape sequence (aka Python source code, aka code point), i.e.:

print("\u20AC") # Euro
print("\u0024") # Dollar
print("\u00A3") # Pound
print("\u00A5") # Yen

€
$
£
¥

References:

Pedro Lobito
  • 94,083
  • 31
  • 258
  • 268