I shan't be posting any more entries to this blog but rest assured that the archives are staying. As part of this move comments have been closed on all of my existing weblog entries. If you have any problems with the new location or just fancy a chat send me an email. My address is andy47 at halfcooked.com.
]]>It's a pleasure to install and work with, but I've had just one niggling problem. Oracle XE uses Application Express for administration and development, except that I couldn't get it to work.
Thanks to this forum thread (sorry, you'll need a login to read it) I just needed to perform a simple chmod 666 to my $ORACLE_HOME/network/log/listener.log file and everything started working fine.
Apparently the Oracle XE application express application is served through the good old fashioned Oracle database listener and it wasn't starting properly. Something as simple as the permissions on the listener log file were causing it to fail at start up, Something I'd probably have figured out myself if I'd bothered to look at the other log files.
]]>Release 0.8.2 includes over 50 sample applications and tools to help users build applications in Python, including codeEditor, findfiles, and resourceEditor (layout editor).
New samples include a US-UK converter and a Sudoku solver. There are a new set of "convenience" functions to assist is creating pop-up menus and some commonly used custom dialogs (usage of these is demonstrated in the Sudoku sample, as well as in a new sample "helpful wrappers").
The tools/oneEditor directory contains a new version of the codeEditor, named tabcodeEditor.py that supports tabbed editor panes and the resource file popups from codeEditorR; once the code is more mature, it will replace the current codeEditor. The original codeEditor remains for now, but (unless problems show up) will likely be removed in the next release.
The tools/resourceEditor directory contains a new version of the resourceEditor, named multiresourceEditor.py which supports a number of operations on multiple components, such as Align, Distribute and Equalize, as well as visual tools to move components (Nudge) and to re-layer them. The other major change is that the Property Window has been redesigned to be larger, and display all properties at once, and allow editing of any of them immediately. The existing resourceEditor remains for now, though if the feedback on the newer layout is OK then the old version may be retired at the next release.
The tools/standaloneBuilder has been extensively revised, and now includes support for py2exe as well as pyInstaller.
PythonCard requires Python 2.3 or later and wxPython 2.5.2.8 or later.
You can download the latest release at:
http://sourceforge.net/project/showfiles.php?group_id=19015
Please be sure to look at the migration_guide.txt file in the docs directory if you are upgrading from a previous release. Since the package name has changed, you can continue to use the older PythonCardPrototype package simultaneously with the new PythonCard package, but you must upgrade to wxPython 2.5.2.8.
All the information you need about PythonCard can be found on the project web page at: http://pythoncard.sourceforge.net/
The installation instructions and walkthroughs are available on the main documentation page: http://pythoncard.sourceforge.net/documentation.html
For a list of most of the samples that have been built with PythonCard and screenshots of them in action go to: http://pythoncard.sourceforge.net/samples/samples.html
The kind people at SourceForge host the project:
http://sourceforge.net/projects/pythoncard/
If you want to get involved the main contact point is the Mailing list:
http://lists.sourceforge.net/lists/listinfo/pythoncard-users
My Powerbook is once more under the knife so I'm back playing around with Ubuntu on my work laptop.
Whilst perusing this Windows to Ubuntu transition guide I discovered that I can turn on user directories quite easily. Of course the instructions are a little misleading and the top Google hit, this Ubuntu forum thread doesn't quite work for me either.
Under Dapper and with Apache2 installed I had to;
$ sudo a2enmod userdir $ sudo /etc/init.d/apache2 force-reload $ cd $ mkdir public_html
And now it's working like a charm. This change means that I can keep all of my files under my home directory and not pollute /var/www like I was doing.
]]>Over the past month or so I've needed it again so I dusted that code off and made some enhancements. First I added support for MySQL and SQLite. As if that wasn't enough I then added an optional where clause parameter, so that you can dump some of the rows in the table. Then I added another optional parameter, this time a column list allowing you to only specify a subset of the columns in the table.
Then I just got carried away and introduced another function which accepts a valid SQL statement and dumps its results to a CSV file.
You can view the code here - csvDump.py or download it from here - csvDump.py.
]]>Do any of the fine readers of this blog know of any organisations that have implemented Oracle Applications in more than a couple of languages? I'm slightly involved in a European implementation and they are talking about having 15 (yes fifteen) functional languages. Endeavours to procure a reference site, or even anything approaching useful information, from Oracle have so far yielded very little of use.
I'm particularly interested in implementation and support war stories. Information on which languages are well supported and which to avoid will also be very welcome.
Can anyone help? Or point me in the direction of someone can? For those fixated on geography the company are based in Australia but the implementation project is being done from the UK.
]]>Anyone whose stated aims include "... to protect and promote the civil liberties of users and operators of computer based communications systems such as the Internet, to advocate the amendment of laws and regulations in Australia and elsewhere (both current and proposed) which restrict free speech and to educate the community at large about the social, political, and civil liberties issues involved in the use of computer based communications systems" gets my vote.
I've joined, shouldn't you?
]]>Congratulations to Catherine Devlin for her recent using Python with Oracle article at OTN. Keep up the good work.
I'd like to add that you don't need to running Windows or Red Hat either. You can install Oracle XE on Debian or Ubuntu and then compile cx_Oracle from source quite easily.
Just make sure that you've installed the appropriate development packages (gcc and build-essential). Then unpack the cx_Oracle source package, cd into the directory it creates and type;
$ sudo python setup.py install
It works like a dream for me and now I've got a development machine with Oracle, MySQL, SQLite and PostgreSQL all running on it. Which gives me plenty of scope for experimenting with cross platform code and comparing and contrasting features of the various databases. Hopefully there will be more on this subject here in the not too distant future.
Update: but wait, there's more. Thanks to Frits Hoogland I discover that Oracle have a Debian repository. I can add this to my /etc/apt/sources.list and keep my database sparkly and up to date. Marvelous.
]]>Meanwhile I've been using my work laptop. It really doesn't hold up well against the Powerbook, but is somewhat nicer to use since I've installed Ubuntu. My gripe here is with the Debian packaging of Thunderbird, my current mail client of choice. I use it to connect to my IMAP mail server and then switch to offline mode when I'm travelling or at work. Except by default Thunderbird doesn't come with this feature on Debian (and therefore Ubuntu). You have to install another package to activate offline mode. A feature I only discovered after I needed it. Bah. People of Debian, ubiquitous network connection is still not with us, offline mode should be included by default just like it is on the Windows and Mac OSX versions of Thunderbird.
]]>Sadly, it's not valid XHTML 1.0 transitional and the CSS could do with a tweak.
]]>In previous years I have followed the proceedings from afar via blog posts and other assorted web pages. Apart from this post by AMK stating that it's all over and has gone well I haven't seen a lot of information over the last few days. Have I been looking in the wrong places? Or was it really not that interesting and didn't need reporting? Or, perish the thought, is blogging so 2002 that no one is posting anything about this year's conference?
]]>A recent poster on the Python DB-Sig mailing list wanted to refer to the individual elements of his fetched rows by name.
By definition this isn't possible with the Python DB-API 2.0 as it specifies that query results be returned as sequences, which most module writer interpret as tuples.
A couple of the usual smart and erudite members of the list provided ways to do this though, and I'm putting them here mainly as a reminder to myself. First, Andy Dustman suggested;
>>> import MySQLdb >>> db=MySQLdb.connect(db="mysql",read_default_file="~/.my.cnf") >>> c=db.cursor() >>> c.execute("select * from user") 6L >>> for row in c.fetchall(): ... d = dict( [ (c.description[i][0], j) for i,j in enumerate(row) ] ) ... print d ... {'Drop_priv': 'Y', 'Execute_priv': 'Y', 'Create_routine_priv': 'Y', 'Repl_client_priv': 'Y', 'Create_user_priv': 'Y', 'Create_priv': 'Y', 'References_priv': 'Y', 'max_user_connections': 0L, 'Shutdown_priv': 'Y', 'Grant_priv': 'Y', 'max_updates': 0L, 'max_connections': 0L, 'Show_db_priv': 'Y', 'Reload_priv': 'Y', 'Super_priv': 'Y', 'Host': 'localhost', 'User': 'root', 'Alter_priv': 'Y', 'ssl_cipher': array('c'), 'Password': 'xxx', 'Delete_priv': 'Y', 'Repl_slave_priv': 'Y', 'Insert_priv': 'Y', 'x509_subject': array('c'), 'ssl_type': '', 'Index_priv': 'Y', 'Create_tmp_table_priv': 'Y', 'x509_issuer': array('c'), 'Create_view_priv': 'Y', 'Select_priv': 'Y', 'Show_view_priv': 'Y', 'Update_priv': 'Y', 'Lock_tables_priv': 'Y', 'Process_priv': 'Y', 'Alter_routine_priv': 'Y', 'File_priv': 'Y', 'max_questions': 0L} ...
Then Carsten Haese, along much the same lines but perhaps slightly more succinctly, suggested;
class RowObject(object): def __init__(self, data, description): self.__dict__.update(dict(zip([col[0] for col in description], data)))for rowdata in cursor.fetchall():
row = RowObject(rowdata, cursor.description)
# now you can do stuff with row.PID, row.FIRSTNAME, or however the columns
# in the query are named.
Of course a little light Googling shows me that there's nothing new in the world and that this topic is covered quite well in the Python Cookbook, with a version of the code above provided in this recipe and an alternative version using Greg Stein's dtuple module in this recipe. Alternatively you can always use db_row.py.
]]>First impressions are only good, and as I actually add content I'll probably start linking to it from here. Wish me luck.
]]>It's available in a number of formats, for instance; JPEG, GIF, and PDF. Thanks for the great work Travis.
]]>