I want to implement inside a function localized formatting so that the typed in value 12,3
is recognized as a float
import locale
def localize(argument):
if argument == "do it":
locale.setlocale(category=locale.LC_ALL,
locale="German")
# locale.setlocale(locale.LC_ALL, 'deu_deu')
x = float(input("type in a float"))
print(x)
else:
pass
I tried every commbination from this thread correct way to set Python's locale on Windows? but so far its not working, Im aware that that the change can be implemented without localized formatting, but I want to do this in this particulare way