Content tagged as code

Experiment: PyQt and QtDesigner - simple form

Qt4 Logo

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 -*-

SVG Image Tiler

Inkscape logo

Ecco qua uno scriptino bash che ho realizzato per "ritagliare" comodamente delle immagini da un file SVG e convertirle automaticamente in PNG.

svgtiler.sh

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.

svgtiler.sh

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.

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

apt (1) e-mail (2) arduino (1) awstats (3) audio (1) debian (1) database (3) apache (1) blender (3) aircrack (1) circuits (1) 3d (3) camera mia (1) documentation (2) citroen (1) aoe (1) contact manager (1) doku (1) address book (2) cocktails (1) como lake rovers (1) cryptography (1) caos (1) Drupal (21) bash (11) archive (1) dmcrypt (1) 2v (1) Drupal Forms (1) C++ (2) debug (1) algorythms (1) development (11) cartoons (1) blogroll (7) backup (3) alcool (1) curl (1) cars (1) code (3)