Menus
Een menubalk is een van de meest zichtbare onderdelen van de GUI applicatie. Het is een groep van commando’s in de verschillende menu’s. Terwijl in de console toepassingen die u had om te onthouden al die mysterieuze commando’s, hier hebben we het grootste deel van de commando’s gegroepeerd. Voor de uitvoering van een menubalk […]
Archive for the ‘Python’ Category
Menus wxPython
mod_python Form data handling
In mod_python, form data is returned as a mapping type (dictionary) instead of a sequence type (tuple or list.)
A very handy way to get the form data is to import the util module from mod python:
from mod_python import util
and then within your handler instantiate an object of the FieldStorage Class:
def myhandler(req):
…(stuff)…
[…]
Os name python
Hoe kom ik de naan van besturingssysteem te weten?
> python
>>> import platform
>>> print platform.system(), platform.release()
Windows XP
$ python
>>> import platform
>>> print platform.system(), platform.release()
Linux 2.4.18-3
pyc or .pyo file in mod_python
On 09/03/07, Tobin Cataldo wrote:
> Greetings,
>
> I would like to ship only .pyo files to a website and use those with
> mod_python. I have seen this question in the archives but haven’t seen a
> clear answer.
>
> I believe the Python Interpreter will choose a .pyc or .pyo file if
> available, but I want to […]
How do I create a password based login feature to my website?
http://www.modpython.org/FAQ/faqw.py?req=show&file=faq03.031.htp
This is a minimalistic but complete example using the Session module to enable a password based login feature to a site. It uses the publisher handler.
There are two files, login.py asks for a password to log the user in and another one which checks if the user was already logged in. In case he/she isn’t […]
Installing Python Modules
This document describes the Python Distribution Utilities (“Distutils’’) from the end-user’s point-of-view, describing how to extend the capabilities of a standard Python installation by building and installing third-party Python modules and extensions.
http://docs.python.org/inst/inst.html
Python Distribution Utilities
This document describes the Python Distribution Utilities (“Distutils’’) from the module developer’s point of view, describing how to use the Distutils to make Python modules and extensions easily available to a wider audience with very little overhead for build/release/install mechanics.
http://docs.python.org/dist/dist.html
WxGlade positioneren GridSizer en BoxSizer
Om opmaak juist te positioneren moet eerst in iedere panel GridSizer toegevoegd worden en dan binnen deze sizer mag BoxSizer gebruikt worden. (Kies flexibel layout)
zie Video
wplite_wxglade_layout.html
http://www.wxpython.org/docs/api/ wxPython API
wxglade python GUI wxWidget
http://wxglade.sourceforge.net/tutorial.php
http://wxglade.sourceforge.net/demo/
NOTE: This version of the tutorial is in sync with the current wxGlade on CVS, so some parts of it might not apply to the latest release.
wxGlade Tutorial
The aim of this minimal tutorial is to give an overview of wxGlade and its functionalities: despite its very short length, it is (hopefully) complete enough to make […]
Screen Recorder vnc2swf
Vnc2swf is a cross-platform screen recording tool for ShockWave Flash (swf) format.
http://www.unixuser.org/%7Eeuske/vnc2swf/
Frequently Asked Questions
What’s the difference between Python version and C version?
Vnc2swf comes with two different implementations:
* Python version (pyvnc2swf):
o Runs on many platforms, including Linux, FreeBSD, Solaris, Mac OS X, […]
Cursor Objects pysqlite
A Cursor instance has the following attributes and methods:
execute( sql, [parameters])
Executes a SQL statement. The SQL statement may be parametrized (i. e. placeholders instead of SQL literals). The sqlite3 module supports two kinds of placeholders: question marks (qmark style) and named placeholders (named style).
This example shows how […]
Module functions and constants pysqlite
PARSE_DECLTYPES
This constant is meant to be used with the detect_types parameter of the connect function.
Setting it makes the sqlite3 module parse the declared type for each column it returns. It will parse out the first word of the declared type, i. e. for “integer primary key”, it […]
Connection Objects pysqlite
A Connection instance has the following attributes and methods:
isolation_level
Get or set the current isolation level. None for autocommit mode or one of “DEFERRED”, “IMMEDIATE” or “EXLUSIVE”. See “Controlling Transactions’’, section 13.13.5, for a more detailed explanation.
cursor( [cursorClass])
The cursor method accepts a single optional parameter cursorClass. If […]
Using SQLite in Python
SQLite is a small C library that implements a self-contained SQL database engine. This article examines pysqlite, one of a number of libraries in Python, that is used as an interface with SQLite.
SQLite is a small database engine that’s gained quite a bit of popularity, and this popularity does appear to be deserved. SQLite stands […]
python syntax
Basic Script
##############################################################################
# name: main
# purpose: entry point of the script
##############################################################################
# sys.argv is a list of command line argument strings (pos 0 is script name)
if __name__ == “__main__”:
print “hello world” # if no comma (,) at end \n is auto included
Data Types
##############################################################################
# name: main
# purpose: show […]
Python DICOM
http://dicomlib.swri.ca/pydicomlib.html
Description
This is a set of python bindings for dicomlib.
It’s great for scripting quick-and-dirty DICOM related tasks, for example, opening a DICOM file, reading and modifying tags, communicating with DICOM servers etc via C-FIND, C-MOVE, C-STORE etc.
Nog een bestand
http://php.iupui.edu/~mmiller3/python/dycom.py.html
http://sourceforge.net/search/?type_of_search=soft&type_of_search=soft&words=dicom+python+
fop Apache
Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL formatting objects (XSL-FO) and an output independent formatter. It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output. Output formats currently supported include PDF, PS, PCL, AFP, XML (area tree representation), Print, […]
python eggs
The Python Package Index is a repository of software for the Python programming language. There are currently 4204 packages here.
http://pypi.python.org/pypi
http://pypi.python.org/pypi?%3Aaction=browse
Pure Python PDF to text converter
Description:
This example shows how to extract text informations from a PDF file without the need of system dependent tools or code. Just use the pyPdf library from http://pybrary.net/pyPdf/
import pyPdf
def getPDFContent(path):
content = ""
# Load PDF into pyPDF
pdf = pyPdf.PdfFileReader(file(path, "rb"))
# Iterate pages
for i in range(0, pdf.getNumPages()):
# Extract text from […]
Dynamic Functions Argumenets
Positional argumenets
In Python-speak, positional arguments are any arguments that aren’t named when you call a function. That is, which variable they go to in the function is defined by their position — first, second, third — instead of their names. This is how most languages work, and is intuitive to most programmers, regardless of their […]
