Advertisement
Guest User

Gestione delle lingue py no class

a guest
Sep 21st, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. LINGUE = ["it","de","ru","pl","fr","de","gr","en","tr"]
  2. def lingua(ling):
  3.    
  4.     f = open("/pack/Index","r")
  5.     text = f.readlines()
  6.     for x in range(0,len(text)):   
  7.         if text[x].startswith("locale/"):
  8.             text[x] = "locale/"+LINGUE[ling]+"/\n"                 
  9.     text1 = "".join(text)  
  10.     f.close()
  11.     f = open("/pack/Index","w")
  12.     f.write(text1)
  13.     f.close()
  14.     f1 = f = open("locale.cfg","w")
  15.     f1.write("10006 1252 "+LINGUE[ling])
  16.     f1.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement