calling super()

2007-04-04 Thread Finger . Octopus
Hello, I have been trying to call the super constructor from my
derived class but its not working as expected. See the code:

class HTMLMain:
def __init__(self):
self.text = HTMLBODY;
print(self.text);
def __del__(self):
self.text = /BODY/HTML;
print(self.text);

class NewPage(HTMLMain):
def __init__(self):
print 'derive2 init'
super(NewPage, self).__init__();


N = NewPage();
del N


And here's the error message I get:

Traceback (most recent call last):
  File e:/PyEN/inherit.py, line 16, in module
N = NewPage();
  File e:/PyEN/inherit.py, line 12, in __init__
super(NewPage, self).__init__();
TypeError: super() argument 1 must be type, not classobj

-- 
http://mail.python.org/mailman/listinfo/python-list


Distributing Python Applications

2007-02-10 Thread Finger . Octopus
Hello,

It has been such a painful thing for me. As I made a program to
encrypt files, now I want to distribute that program over other
computers. I created .EXE file with py2exe but the dist folder makes
around 2 mb and it restricts for the python DLL to be within the same
folder. Is there any easy way to get this thing done in just one exe
file? I mean if I do interfacing with C/C++ will it work for me and if
I do interfacing with C/C++ will it be necessary on the other computer
to have python installed on it?


Thanks in advance...

-- 
http://mail.python.org/mailman/listinfo/python-list


Problem - Win32 Programming

2007-02-09 Thread Finger . Octopus
Hi ..

I'm a newbie to python win32 programming. I was just reading Python
Programming on Win32 and I was trying to run this program:

# SimpleCOMServer.py - A sample COM server - almost as small as they
come!
#
# We expose a single method in a Python COM object.
class PythonUtilities:
_public_methods_ = [ 'SplitString' ]
_reg_progid_ = PythonDemos.Utilities
# NEVER copy the following ID
# Use print pythoncom.CreateGuid() to make a new one.
_reg_clsid_ = {41E24E95-D45A-11D2-852C-204C4F4F5020}

def SplitString(self, val, item=None):
import string
if item != None: item = str(item)
return string.split(str(val), item)

# Add code so that when this script is run by
# Python.exe, it self-registers.
if __name__=='__main__':
print Registering COM server...
import win32com.server.register
win32com.server.register.UseCommandLine(PythonUtilities)


I am using Python 2.5 and it says:

Traceback (most recent call last):
  File E:/PyEN/PythonUtilities.py, line 20, in module
import win32com.server.register
ImportError: No module named win32com.server.register

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problem - Win32 Programming

2007-02-09 Thread Finger . Octopus
What shoud I do to fix it?

-- 
http://mail.python.org/mailman/listinfo/python-list


Database Programming with Python

2007-02-09 Thread Finger . Octopus
Hi

I wanted to connect Python to Ms-Access database using ADO or ODBC. I
have Python 2.5 and on mxODBC site, it has no higher version build
than 2.4. Moreoever, mxODBC is required for ADODB.
Can anyone guide me on this what should I do to make it work on Python
2.5? I have python 2.5 running on server.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Database Programming with Python

2007-02-09 Thread Finger . Octopus
 You could use Dejavu 1.5, which has its own wrapper [1] for ADO (both
 MS Access and SQL Server/MSDE). No ODBC necessary or desired.

 If you want an ADO wrapper without the full Dejavu ORM, it's possible
 (but not heavily documented) to use dejavu's geniusql layer on its
 own. That would give you connection mgmt (and pooling), along with the
 ability to execute arbitrary SQL.

 Robert Brewer
 System Architect
 Amor Ministries
 [EMAIL PROTECTED]

 [1]http://projects.amor.org/dejavu/browser/trunk/storage/storeado.py


There are no examples of Dejavu that I found yet. I have installed it
but don't know how to use or call its functions.

-- 
http://mail.python.org/mailman/listinfo/python-list


How can I access data from MS Access?

2007-02-03 Thread Finger . Octopus
How to access data from MS Access? I tried ADOdb for Python but it
doesn't seems to work.

Even the official examples dont work, like this one:

import adodb
conn = adodb.NewADOConnection('access') # mxodbc required
dsn = Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\inetpub\\adodb\
\northwind.mdb;
conn.Connect(dsn)


(I have downloaded mxodbc, but still it doesn't works)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: How can I access data from MS Access?

2007-02-03 Thread Finger . Octopus
On Feb 3, 10:27 pm, Bruno Desthuilliers
[EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] a écrit : How to access data from MS Access? I tried ADOdb 
 for Python but it
  doesn't seems to work.

  Even the official examples dont work, like this one:

  import adodb
  conn = adodb.NewADOConnection('access') # mxodbc required
  dsn = Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\inetpub\\adodb\
  \northwind.mdb;
  conn.Connect(dsn)

  (I have downloaded mxodbc, but still it doesn't works)

 doesn't work is the worst possible description of a problem. Did it
 print out some insults in a foreign language ? wipe out your HD ? Else ?

I havn't said doesn't work, I rather doesn't seem to work.

-- 
http://mail.python.org/mailman/listinfo/python-list