
Introduction et prise en main de PyQt L'objectif du projet va être de créer une application de gestion de bateaux, pour ne pas reprendre l'exemple bateau d'un petit éditeur de textes. Ce sera un simple CRUD qui va permettre de créer, éditer et supprimer une liste de bateaux stockée dans une base de données SQLite. On verra ainsi un certain nombre de composants basiques de Qt comme un tableau, un widget de texte simple, un label et des boutons, ainsi que des concepts de base de Qt comme les signaux et les composants orientésMVD (Modèle Vue Délégué). Nous allons commencer par la création de l'écran en utilisant QtCreator. L'installation de QtCreator ne devrait pas poser trop de problèmes et se passe bien sur de nombreuses plateformes. Pour partir sur de bonnes bases nous allons donc créer un nouveau projet en utilisant le menu Fichier -> Nouveau fichier ou projet ..., on arrive alors sur l'écran suivant, où l'on va choisir "Projet Qt4 vide" : On choisit le nom du projet et son répertoire racine : Pour obtenir le code suivant :
GUI Programming with PyQT Boudewijn Rempt Copyright © 2001 by Commandprompt, Inc Copyright (c) 2001 by Command Prompt, Inc. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at ‘Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.' to the license reference or copy. ‘Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.' to the license reference or copy. Although every reasonable effort has been made to incorporate accurate and useful information into this book, the copyright holders make no representation about the suitability of this book or the information therein for any purpose. This book is dedicated to Irina.
Writing a Package in Python Home by Tarek Ziadé Intents of this article are: To shorten the time needed to set up everything before starting the real work, in other words the boiler-plate codeTo provide a standardized way to write packagesTo ease the use of a test-driven development approachTo facilitate the releasing process It is organized in the following four parts: A common pattern for all packages that describes the similarities between all Python packages, and how distutils and setuptools play a central role How generative programming ( can help this through the template-based approach The package template creation, where everything needed to work is setSetting up a development cycle A Common Pattern for All Packages The easiest way to organize the code of an application is to split it into several packages using eggs. Applications for a given company can have a set of eggs glued together with a master egg. setup.py, the Script That Controls Everything sdist test
La programmation scientifique avec Python La programmation scientifique avec Python, une alternative gratuite, libre et performante à Matlab, IDL, Scilab, etc. et un complément pratique et utile au C et/ou au Fortran. La programmation scientifique, c'est quoi ? Pour qui ? Je dois savoir quoi ? Qu'est-ce que c'est ? C'est l'utilisation de l'informatique et des langages de programmation pour résoudre un problème numérique. Donc détaillons : La programmation scientifique sert à résoudre des problèmes le plus souvent mathématiques grâce à l'utilisation d'algorithmes numériques optimisés pour les ordinateurs modernes. Pour qui ? Prérequis ? Savoir compter ; Être au point sur les notions mathématiques de vecteur, matrice, et plus généralement sur l'algèbre. Compter avec Python ? Pourquoi faire du calcul scientifique avec Python me demanderez vous, c'est interprété (donc moins rapide), c'est gratuit (donc louche ), et de toutes façons rien ne remplace le C et/ou le Fortran Alors donc pourquoi Python : Ouverture des hostilités
QCoreApplication + event looping [Archive] - Qt Centre Forum Likely the signial in the same thread will be executed immediately, while the one in the different thread will be queued. But it could be that they both end up being queued. Don't guess. If you don't know, rely on what someone else is saying or check in the source code. The signal (the method declared in the "signals" section) is executed only once. There can be zero or more slots connected to the signal and each of them will be executed when the right time comes. There is a terminology problem here. There are four entities to consider: The emit, the slot, the connection, and the "signal", which is essentially a message. If something is queued, it is the signal. There is no check for threads here, the signal is activated immediately. If something is queued, it is the signal.
Creando archivos xls en Python y Avanzado « Rctorr's Blog Y siguiendo con lo retos, ahora el primero es como adicionar estilos y formatos a un celda de un archivo xls desde Python por su puesto, hee que si fuera desde Calc o Excel sería pan comido o talves no! … Los obtejtivos que me interesa poder lograr son: Asignar tipo de fuenteAsignar tipo de letraAsignar tamaño de letraAsignar alineaciónAsignar bordeAsignar formatoAsignar ancho y alto Sigo trabajando con la la clase xls_writer.py que hasta el momento me ha resultado genial y que invita incluso a extenderla para incluir nuevos métodos, sin embargo la documentación viene de la mano de xlwt. Hay una clase llamada xlwt.easyxf que formatea una cadena del tipo ‘font: bold on; align: wrap on, vert centre, horiz center’ y regresa una instancia que puede ser usando en el método sheet.write, un ejemplo sería como el sigue: el resultado es el siguiente: También comentar que he tenido que modificar el método writer.append() para que acepte la opción del formato en xls_writer.py y el resultado es: Salud!!
2.6. Image manipulation and processing using Numpy and Scipy — Scipy lecture notes This chapter addresses basic image manipulation and processing using the core scientific modules NumPy and SciPy. Some of the operations covered by this tutorial may be useful for other kinds of multidimensional array processing than image processing. In particular, the submodule scipy.ndimage provides functions operating on n-dimensional NumPy arrays. Image = 2-D numerical array (or 3-D: CT, MRI, 2D + time; 4-D, ...) Here, image == Numpy array np.array Tools used in this tutorial: numpy: basic array manipulationscipy: scipy.ndimage submodule dedicated to image processing (n-dimensional images). Common tasks in image processing: Input/Output, displaying imagesBasic manipulations: cropping, flipping, rotating, ...Image filtering: denoising, sharpeningImage segmentation: labeling pixels corresponding to different objectsClassificationFeature extractionRegistration... More powerful and complete modules: OpenCV (Python bindings)CellProfilerITK with Python bindingsmany more... 2.6.1. 2.6.2. 2.6.3.
QApplication Class Reference The QApplication class manages the GUI application's control flow and main settings. More... QApplication::QApplication ( int & argc, char ** argv ) Initializes the window system and constructs an application object with argc command line arguments in argv. Warning: The data referred to by argc and argv must stay valid for the entire lifetime of the QApplication object. The global qApp pointer refers to this application object. This application object must be constructed before any paint devices (including widgets, pixmaps, bitmaps etc.). Note: argc and argv might be changed as Qt removes command line arguments that it recognizes. Qt debugging options (not available if Qt was compiled without the QT_DEBUG flag defined): -nograb, tells Qt that it must never grab the mouse or the keyboard. See Debugging Techniques for a more detailed explanation. All Qt programs automatically support the following command line options: -style= style, sets the application GUI style. X11 Notes See also arguments().