Sonntag, November 12, 2006

Comming soon


Abstract:

  • something about the Python scripts I've written in the past
  • the advantages of switching to IronPython
  • initial problems when applying IronPython to real tasks
  • the audiance I will reach with this blog
Zusammenfassung:
  • Ich erkläre kurz die Art von C-Python Skripten, die ich bisher geschrieben habe
  • warum mir IronPython eine Fülle neuer Möglichkeiten eröffnet
  • welche Anfangsprobleme beim Umstieg auf IronPython auftraten
  • wen ich in diesem Blog ansprechen möchte

Most of the python I've done in the past just was the combination of Filesystem-Access and a lot of fiddling with regular expression (module re). Most of these scripts process SQL-Server scripts and produce some resturctured, beautified and well -wrapped scripts as output. A second kind helps me transforming scripts to Oracle.

I'm not using any sql-grammars, only heuristic aproches. When the sql is written in suitable format this aproch is goes rather far.

My standard editor for python is IDLE.

Speaking german most python scripts will include strings containing our german Umlaute (äöüßÄÖÜ) and some other characters as (§ µ °) which are not includes in the 7-bit Ascii half.

So I had to chose between starting the python-scripts
with either

# -*- coding: cp1252 -*-

or using lots of unreadable escape sequences.


The sql scripts I have to process use a nice mixtures of OEM 850, cp1252 , utf8 and some were corupted by editing them using the wrong characterset. [That's just live].

Unicode or not can be detected automaticly. And for the rest one can take a pragmatic approch. Only a few additional character with ord() > 127 are in commen use in the german local and the sets of these codes from the two chartersets do not overlap.

Did you notice that I told nothing of database access from python. Well I just didn't try.

Database access is a fundamental part of my every days work. Anything from DAO ( help me forget all about VB3), ADO (VB6) und finally ADO.NET (C#). But without IronPython database access needs some additional components and I get no one else to use it.

IronPython = Python + integrated Database access + Windows.Forms

With IronPython I use exactly the same components as the C# devellopers.

The framework 2.0 is installed or comes any case, all what is missing is the download, unpacking and copying of the IronPython directory and they can start.

Ok I assume you have your databases allready working and if you are using Oracle you may have to get the ODP Database Provider for.Net.

In short: I intend to use IronPython mainly for scripting of .NET. I know about the way to access the python modules from a current C-Phython installation and I know about the FePython people, but I don't think I'll need their modules soon.

My intendet audiance are primarily DBAs of Oracle and SQL-Server Databases and of corse all python fans who are interessted in this topic.

In coming post I intend
  • a minimal Installation HowTo (in german) for DBAs in .Net environments, which just need to add IronPython to their toolbox
  • some small talk about the pitfalls I met switching from Python to IronPython. Most dealing with charactersets, unicode and €.
  • explore the posibilities of accessing the databases by .Net (presumably a never ending story). Let's dive into ADO.NET
  • some little wrappers around sql*plus and query analyzer so that I can use them for things they are suited for (and redirect their nasty error messages)

Keine Kommentare: