Bonjour à tous,
Je suis nouveau sur le forum et j'ai besoin d'aide. J’étudie en sonorisation et mon projet est de créer une façon de redimensionner un skin.xml (pour programme de mixage) pour différente taille d'écran.
J'ai trouvé ce code sur un site :
Ma question est... comment exécuter ce code pour qu'il modifie tout les <Pos> et <Size> dans le fichier skin.xml ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 def calculatepos(match): # replace the two integer with scaled integers return '<Pos>%s%s,%s' % (str(int((int(match.group(1))*.625+0.5))),str(match.group(2)),str(int((int(match.group(3))*.75+0.5)))) def calculate(match): # replace the two integer with scaled integers return '<Size>%s%s,%s' % (str(int((int(match.group(1))*.625+0.5))),str(match.group(2)),str(int((int(match.group(3))*.75+0.5)))) editor.rereplace('<Pos>([0-9]+)(.*),([0-9]+)',calculatepos) 62editor.rereplace('<Size>([0-9]+)(.*),([0-9]+)',calculate)
J'utilise Python 2.7 et Notepad++ 6.0. Le fichier skin.xml contient + de 6000 lignes, donc, trop long à modifier manuellement.
Merci pour votre aide !
Clicker
Partager