This is a simple experiment i have done with PyQt, creating the interface with QtDesigner.
1.First, create the interface using QtDesigner and save it as simple_form.ui
2.Then, create a Python module containing the generated UI class source code:
1 |
pyuic4 -x simple_form.ui > ui_simple_form.py |
3.Now, you have your interface class. If you want to test it, just run the module as:
1 |
python ui_simple_form.py |
4.To include it in a more complex application, write something like:
1 2 |
#!/usr/bin/env python # -*- coding: utf-8 -*- |
Ecco qua uno scriptino bash che ho realizzato per "ritagliare" comodamente delle immagini da un file SVG e convertirle automaticamente in PNG.
Il tutto in BashScript, appoggiandomi su Inkscape..
Il funzionamento è molto semplice: vengono definite le dimensioni della "griglia", altezza e larghezza delle tile e numero in verticale e orizzontale. quindi, definiti gli id delle tile interessanti (specificati come righe/colonne) lo script procede chiamando inkscape per esportare le parti utili dell'immagine in un dato percorso di destinazione.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #!/bin/bash # # SVG Image Tiler - transform SVG images into PNG tiles # Copyright (C) 2009 Samuele ~redShadow~ Santi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |