-3

How on earth do i shrink this monstrosity:

I´m using python 3

if "arME" in file or "deDE" in file or "enUS" in file or "esES" in file or "ptBR" in file or "itIT" in file:

1 Answers1

0

Typically one would use an alternative regex:

p = re.compile('arME|deDE|enUS|esES|ptBR|itIT')
if p.search(file):
    ...

The A|B in a regex means match either A or B, where A and B are arbitrary regexes. It can be extended to an arbitrary number of regexes.

Ted Hopp
  • 232,168
  • 48
  • 399
  • 521