From sergej.pioch at rz.uni-freiburg.de Mon Sep 1 10:51:19 2003
From: sergej.pioch at rz.uni-freiburg.de (Sergej Pioch)
Date: Mon Sep 1 03:52:34 2003
Subject: [python-win32] Problems py2exe and Windows Services...
Message-ID: <3F52FA77.4000507@rz.uni-freiburg.de>
Hello everybody,
I have certain problems building a windows executable fileset from a
python windows service using py2exe. Before going any further with the
description of the problem I have to tell you, that I am pretty new to
python.
I use the Activestate Activepython distrib version 2.2.2 build 224 on
Windows XP (for development).
I wrote the following UPS-Service in Python (should run on Windows2000
and 2003 Servers). Here is the source:
------
# ZebrAPClient.py
#
# Service to look for an UPS caused shutdown
import win32serviceutil
import win32service
import win32event
from win32file import *
import win32api
import os
import socket
class ZebrAPClient(win32serviceutil.ServiceFramework):
_svc_name_ = 'ZebrAPClient'
_svc_display_name_ = 'ZebrAPClient'
def __init__(self, args):
win32serviceutil.ServiceFramework.__init__(self, args)
self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
def SvcStop(self):
self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
win32event.SetEvent(self.hWaitStop)
def SvcDoRun(self):
Directory = '\\\\Path_to\\batch.file'
X=1
while X==1:
rc = win32event.WaitForSingleObject(self.hWaitStop, 1)
if rc==win32event.WAIT_OBJECT_0:
break
else:
try:
Content = CreateFile(
Directory,
GENERIC_READ,
FILE_SHARE_READ,
None,
OPEN_EXISTING,
0,
None )
Action = ReadFile(Content, 256)
Content.Close()
except win32api.error, (code, function, message):
continue
if Action[0]==0:
os.system(Action[1]) # Hier bitte mehrzeilige
Befehlentgegennahme einf?gen!
X=0
else:
continue
if __name__ == '__main__':
win32serviceutil.HandleCommandLine(ZebrAPClient)
-----
It works really good. Now I want to generate a binary package for easier
distribution to the servers ( in this case: without installing the whole
python environment on every server). At google I found the tool 'py2exe'
which I try to use. I wrote the following script 'setup.py':
-----
from distutils.core import setup
import py2exe
setup(name='ZebrAPClient',
description="Get UPS commands to control servers",
version='0.9.0',
scripts=['ZebrAPClient.py'])
-----
In addition I use this 'setup.cfg':
----
[py2exe]
service=ZebrAPClient
optimize=2
excludes=perfmon
version_companyname = XXXXXXXXXXXXX
version_filedescription = UPS Control Service
version_fileversion = 0.9.0
version_legalcopyright = XXXXXXXXXXXXXXXXX
version_legaltrademarks = ZebrAPClient
version_productname = ZebrAPClient
version_productversion = 0.9.0
---
Now I try to build the package with the following command:
'setup.py py2exe -s ZebrAPClient'
And here's the output:
----
running py2exe
running build
running build_scripts
not copying ZebrAPClient.py (up-to-date)
running install_scripts
not copying build\scripts-2.2\ZebrAPClient.py (output up-to-date)
+----------------------------------------------------
| Processing script ZebrAPClient.py with py2exe-0.4.1
+----------------------------------------------------
Searching modules needed to run 'ZebrAPClient.py' on path:
['C:\\Documents and Settings\\this.PROFILE\\My
Documents\\ZebrAPC\\build\\bdist.win32\\winexe\\lib\\Python22\\Lib\\site-packages',
'C:\\Documents and Settings\\this.PROFILE\\My Documents\\ZebrAPC',
'C:\\Python22\\Lib\\site-packages\\Pythonwin',
'C:\\Python22\\Lib\\site-packages\\win32',
'C:\\Python22\\Lib\\site-packages\\win32\\lib',
'C:\\Python22\\Lib\\site-packages', 'C:\\Python22\\DLLs', 'C:\
\Python22\\lib', 'C:\\Python22\\lib\\lib-tk', 'C:\\Python22']
Traceback (most recent call last):
File "C:\Documents and Settings\this.PROFILE\My
Documents\ZebrAPC\setup.py", line 7, in ?
scripts=['ZebrAPClient.py'])
File "C:\Python22\lib\distutils\core.py", line 138, in setup
dist.run_commands()
File "C:\Python22\lib\distutils\dist.py", line 893, in run_commands
self.run_command(cmd)
File "C:\Python22\lib\distutils\dist.py", line 913, in run_command
cmd_obj.run()
File "C:\Python22\Lib\site-packages\py2exe\build_exe.py", line 604, in run
mf.import_hook(f)
File "C:\Python22\Lib\site-packages\py2exe\tools\modulefinder.py",
line 126, in import_hook
q, tail = self.find_head_package(parent, name)
File "C:\Python22\Lib\site-packages\py2exe\tools\modulefinder.py",
line 180, in find_head_package
raise ImportError, "No module named " + qname
ImportError: No module named pywintypes
----
The command 'setup.py bdist --formats=wininst' works fine but does of
course not lead to the desired result.
Anyone any idea?
Best regards
Sergej
From sergej.pioch at rz.uni-freiburg.de Mon Sep 1 13:37:33 2003
From: sergej.pioch at rz.uni-freiburg.de (Sergej Pioch)
Date: Mon Sep 1 06:38:44 2003
Subject: [python-win32] Problems py2exe and Windows Services...
References: <3F52FA77.4000507@rz.uni-freiburg.de>
Message-ID: <3F53216D.2000502@rz.uni-freiburg.de>
Sergej Pioch wrote:
> Hello everybody,
>
> I have certain problems building a windows executable fileset from a
> python windows service using py2exe. Before going any further with the
> description of the problem I have to tell you, that I am pretty new to
> python.
>
> I use the Activestate Activepython distrib version 2.2.2 build 224 on
> Windows XP (for development).
O.K. here is the breaking point. In a fit of intuition I changed my
Python-distro from Activestate to the origin Python 2.3 distribution
from python.org. And - how nice - now it works. There seems to be a
problem in the foresaid Activestate distribution.
Greetings
Sergej
From bjarrett at garcoschools.org Mon Sep 1 09:14:52 2003
From: bjarrett at garcoschools.org (Brian Jarrett)
Date: Mon Sep 1 10:23:30 2003
Subject: [python-win32] ASP/Python problems with HTMLgen...
Message-ID: <0067E36738F75E4BB04832584BAED63C16DB9B@hydrogen.garcoschools.org>
I've tried several ways of getting HTML generated using HTMLgen. Here is the code I ended with:
<%@ Language = Python %>
<%
from HTMLgen import *
doc = SimpleDocument(title="Hello")
doc.append(Heading(1, "Hello World"))
doc.write()
%>
All it gives me is "
" when I view the source.
Only Response.Write seems to work, but using it with the "doc" object above gives me a com error.
Can someone point me in the right direction? Am I going to have to scrap using HTMLgen?
Brian
From andrew-pywin32 at puzzling.org Tue Sep 2 11:41:07 2003
From: andrew-pywin32 at puzzling.org (Andrew Bennetts)
Date: Mon Sep 1 20:41:16 2003
Subject: [python-win32] ASP/Python problems with HTMLgen...
In-Reply-To: <0067E36738F75E4BB04832584BAED63C16DB9B@hydrogen.garcoschools.org>
References: <0067E36738F75E4BB04832584BAED63C16DB9B@hydrogen.garcoschools.org>
Message-ID: <20030902004107.GA20233@frobozz>
On Mon, Sep 01, 2003 at 08:14:52AM -0600, Brian Jarrett wrote:
> I've tried several ways of getting HTML generated using HTMLgen. Here is the code I ended with:
>
> <%@ Language = Python %>
> <%
> from HTMLgen import *
>
> doc = SimpleDocument(title="Hello")
> doc.append(Heading(1, "Hello World"))
> doc.write()
>
> %>
>
> All it gives me is "" when I view the source.
> Only Response.Write seems to work, but using it with the "doc" object above gives me a com error.
>
> Can someone point me in the right direction? Am I going to have to scrap using HTMLgen?
I'm guessing that 'doc.write()' writes to stdout, which is useless in an ASP
script. You'll need to get the string that doc.write generates somehow, and
call Response.Write with it.
Something like this might work:
<%@ Language = Python %>
<%
from HTMLgen import *
from cStringIO import StringIO
doc = SimpleDocument(title="Hello")
doc.append(Heading(1, "Hello World"))
f = StringIO()
doc.write(f)
Response.Write(f.getvalue())
%>
-Andrew.
From bjarrett at garcoschools.org Mon Sep 1 23:16:53 2003
From: bjarrett at garcoschools.org (Brian Jarrett)
Date: Tue Sep 2 00:17:26 2003
Subject: [python-win32] ASP/Python problems with HTMLgen...
Message-ID: <0067E36738F75E4BB04832584BAED63C01692D@hydrogen.garcoschools.org>
> I'm guessing that 'doc.write()' writes to stdout, which is
> useless in an ASP
> script. You'll need to get the string that doc.write
> generates somehow, and
> call Response.Write with it.
>
> Something like this might work:
>
> <%@ Language = Python %>
> <%
> from HTMLgen import *
> from cStringIO import StringIO
>
> doc = SimpleDocument(title="Hello")
> doc.append(Heading(1, "Hello World"))
> f = StringIO()
> doc.write(f)
> Response.Write(f.getvalue())
>
> %>
>
> -Andrew.
>
Now that you mention it, I see several people mention in the archives the problem with print going to stdout instead of the asp page. The "" must be auto-generated for all ASP pages.
Unfortunately, your solution did not work, I got another error. I have seen some other posts about this sort of problem, so if I get a good solution, I'll post it back here.
I was hoping to be able to take what I can generate from command line and just have ASP display it, but it's looking increasingly doubtful that I will be able to just "cut N paste" my scripts in.
That would be a good module to develop. I'll have to learn more in this area.
Brian
From zopedope at optonline.net Tue Sep 2 08:22:31 2003
From: zopedope at optonline.net (Bentzion Schochet)
Date: Tue Sep 2 07:23:11 2003
Subject: [python-win32] Explorer Bar interface?
Message-ID: <008801c37144$809ddcd0$6401a8c0@BensLaptop>
is it possible to implement an Explorer Bar in python. Has anyone done
this?
The explorer bar need to implement the following interfaces
IClassFactory, IDeskBand, IObjectWithSite and IPersistStream.
For starters I'd just like to know if it is even possible to create one
with
just Python, additionally if anyone has done this I would appreciate any
sample code.
Thanks in advance,
Ben
From PYTHON at telefonica.net Wed Sep 3 22:20:08 2003
From: PYTHON at telefonica.net (PYTHON@telefonica.net)
Date: Thu Sep 4 14:06:55 2003
Subject: [python-win32] Closing Acrobat
Message-ID: <2e08e2a5b4.2a5b42e08e@teleline.es>
Hi , I?m newbie with python and i need some help...
I have an aplication that creates a .PDF file and at the end of the
execution, Adobe Acrobat is launched automatically (without my control:
handlers...).
The problem I have is I don?t know how can I close the Adobe Acrobat
aplication, i?ve tried:
ad=win32com.client.Dispatch("Acrobat.CAcroApp")
says:
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
com_error: (-2147221005, 'Wrong string class', None, None)
maybe i should kill the process?
if that is the solution, how can i get the PID of the process "Adobe
Acrobat"?
Thank you very much.
From henni at brainbot.com Thu Sep 4 19:29:28 2003
From: henni at brainbot.com (Thorsten Henninger)
Date: Thu Sep 4 14:16:31 2003
Subject: [python-win32] Problems py2exe and Windows Services...
In-Reply-To: <3F52FA77.4000507@rz.uni-freiburg.de>
References: <3F52FA77.4000507@rz.uni-freiburg.de>
Message-ID: <3F576868.2030605@brainbot.com>
Hi,
I use the McMillan Installer
http://www.mcmillan-inc.com/install1.html
to build windows executables, just a tip, if py2exe is still not working ...
regards,
Thorsten
Sergej Pioch wrote:
> Hello everybody,
>
> I have certain problems building a windows executable fileset from a
> python windows service using py2exe. Before going any further with the
> description of the problem I have to tell you, that I am pretty new to
> python.
>
> I use the Activestate Activepython distrib version 2.2.2 build 224 on
> Windows XP (for development).
>
> I wrote the following UPS-Service in Python (should run on Windows2000
> and 2003 Servers). Here is the source:
>
> ------
> # ZebrAPClient.py
> #
> # Service to look for an UPS caused shutdown
>
>
> import win32serviceutil
> import win32service
> import win32event
> from win32file import *
> import win32api
> import os
> import socket
>
>
>
>
> class ZebrAPClient(win32serviceutil.ServiceFramework):
> _svc_name_ = 'ZebrAPClient'
> _svc_display_name_ = 'ZebrAPClient'
> def __init__(self, args):
> win32serviceutil.ServiceFramework.__init__(self, args)
> self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
> def SvcStop(self):
> self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
> win32event.SetEvent(self.hWaitStop)
> def SvcDoRun(self):
> Directory = '\\\\Path_to\\batch.file'
> X=1
> while X==1:
> rc = win32event.WaitForSingleObject(self.hWaitStop, 1)
> if rc==win32event.WAIT_OBJECT_0:
> break
> else:
> try:
> Content = CreateFile(
> Directory,
> GENERIC_READ,
> FILE_SHARE_READ,
> None,
> OPEN_EXISTING,
> 0,
> None )
> Action = ReadFile(Content, 256)
> Content.Close()
> except win32api.error, (code, function, message):
> continue
> if Action[0]==0:
> os.system(Action[1]) # Hier bitte mehrzeilige
> Befehlentgegennahme einf?gen!
> X=0
> else:
> continue
>
> if __name__ == '__main__':
> win32serviceutil.HandleCommandLine(ZebrAPClient)
> -----
>
> It works really good. Now I want to generate a binary package for
> easier distribution to the servers ( in this case: without installing
> the whole python environment on every server). At google I found the
> tool 'py2exe' which I try to use. I wrote the following script
> 'setup.py':
>
> -----
> from distutils.core import setup
> import py2exe
>
> setup(name='ZebrAPClient',
> description="Get UPS commands to control servers",
> version='0.9.0',
> scripts=['ZebrAPClient.py'])
> -----
>
> In addition I use this 'setup.cfg':
>
> ----
> [py2exe]
> service=ZebrAPClient
> optimize=2
> excludes=perfmon
> version_companyname = XXXXXXXXXXXXX
> version_filedescription = UPS Control Service
> version_fileversion = 0.9.0
> version_legalcopyright = XXXXXXXXXXXXXXXXX
> version_legaltrademarks = ZebrAPClient
> version_productname = ZebrAPClient
> version_productversion = 0.9.0
> ---
>
> Now I try to build the package with the following command:
>
> 'setup.py py2exe -s ZebrAPClient'
>
> And here's the output:
>
> ----
> running py2exe
> running build
> running build_scripts
> not copying ZebrAPClient.py (up-to-date)
> running install_scripts
> not copying build\scripts-2.2\ZebrAPClient.py (output up-to-date)
> +----------------------------------------------------
> | Processing script ZebrAPClient.py with py2exe-0.4.1
> +----------------------------------------------------
> Searching modules needed to run 'ZebrAPClient.py' on path:
> ['C:\\Documents and Settings\\this.PROFILE\\My
> Documents\\ZebrAPC\\build\\bdist.win32\\winexe\\lib\\Python22\\Lib\\site-packages',
> 'C:\\Documents and Settings\\this.PROFILE\\My Documents\\ZebrAPC',
> 'C:\\Python22\\Lib\\site-packages\\Pythonwin',
> 'C:\\Python22\\Lib\\site-packages\\win32',
> 'C:\\Python22\\Lib\\site-packages\\win32\\lib',
> 'C:\\Python22\\Lib\\site-packages', 'C:\\Python22\\DLLs', 'C:\
> \Python22\\lib', 'C:\\Python22\\lib\\lib-tk', 'C:\\Python22']
> Traceback (most recent call last):
> File "C:\Documents and Settings\this.PROFILE\My
> Documents\ZebrAPC\setup.py", line 7, in ?
> scripts=['ZebrAPClient.py'])
> File "C:\Python22\lib\distutils\core.py", line 138, in setup
> dist.run_commands()
> File "C:\Python22\lib\distutils\dist.py", line 893, in run_commands
> self.run_command(cmd)
> File "C:\Python22\lib\distutils\dist.py", line 913, in run_command
> cmd_obj.run()
> File "C:\Python22\Lib\site-packages\py2exe\build_exe.py", line 604,
> in run
> mf.import_hook(f)
> File "C:\Python22\Lib\site-packages\py2exe\tools\modulefinder.py",
> line 126, in import_hook
> q, tail = self.find_head_package(parent, name)
> File "C:\Python22\Lib\site-packages\py2exe\tools\modulefinder.py",
> line 180, in find_head_package
> raise ImportError, "No module named " + qname
> ImportError: No module named pywintypes
> ----
>
> The command 'setup.py bdist --formats=wininst' works fine but does of
> course not lead to the desired result.
>
>
> Anyone any idea?
>
>
> Best regards
>
>
> Sergej
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
From janeaustine50 at hotmail.com Fri Sep 5 04:49:11 2003
From: janeaustine50 at hotmail.com (Austine Jane)
Date: Thu Sep 4 14:49:18 2003
Subject: [python-win32] Active Scripting in Python
Message-ID:
I donwloaded win32all for Python 2.3 and installed it.
I manually run pyscript.py and it returned "successfully registered"
message.
For a simple test(on client side), I created the following html:
And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.
After googling, I tried "pyscript.py --debug" and the trace collector
shows:
Object with win32trace dispatcher created (object=None)
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None
Am I doing something stupid?
Jane
x-posted on c.l.p
_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
From jeff at ccvcorp.com Thu Sep 4 14:26:54 2003
From: jeff at ccvcorp.com (Jeff Shannon)
Date: Thu Sep 4 16:24:23 2003
Subject: [python-win32] Active Scripting in Python
References:
Message-ID: <3F57A00E.8020606@ccvcorp.com>
Austine Jane wrote:
> I donwloaded win32all for Python 2.3 and installed it.
>
> I manually run pyscript.py and it returned "successfully registered"
> message.
>
> For a simple test(on client side), I created the following html:
>
>
>
> And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
> anything.
Is this embedded within a full html page? (I.e., is it wrapped with
at least tags?) If not, that may be the problem.
Also, Python is much pickier than VB/Jscript about specifying the full
namespace of objects. Where's this alert() coming from? You may need
to specify it as belonging to the document or the application object.
Jeff Shannon
Technician/Programmer
Credit International
From mailings at johnnydebris.net Wed Sep 3 18:54:15 2003
From: mailings at johnnydebris.net (Guido Wesdorp)
Date: Thu Sep 4 18:06:07 2003
Subject: [python-win32] ASP/Python problems with HTMLgen...
In-Reply-To: <0067E36738F75E4BB04832584BAED63C16DB9B@hydrogen.garcoschools.org>
References: <0067E36738F75E4BB04832584BAED63C16DB9B@hydrogen.garcoschools.org>
Message-ID: <3F560EA7.7000307@johnnydebris.net>
Brian Jarrett wrote:
>I've tried several ways of getting HTML generated using HTMLgen. Here is the code I ended with:
>
><%@ Language = Python %>
><%
>from HTMLgen import *
>
>doc = SimpleDocument(title="Hello")
>doc.append(Heading(1, "Hello World"))
>doc.write()
>
>%>
>
>All it gives me is "" when I view the source.
>Only Response.Write seems to work, but using it with the "doc" object above gives me a com error.
>
>Can someone point me in the right direction? Am I going to have to scrap using HTMLgen?
>
>Brian
>
>
This is a bit of a long shot, I don't know HTMLGen at all, but reading
through some small tutorial I noticed they use 'print doc' to send the
output to stdout. Therefore I think using 'Response.Write(str(doc))' or
'Response.Write(repr(doc))' may work.
Cheers,
Guido
From henni at brainbot.com Thu Sep 4 19:25:34 2003
From: henni at brainbot.com (Thorsten Henninger)
Date: Thu Sep 4 19:39:46 2003
Subject: [python-win32] using win32 language independent
Message-ID: <3F57677E.4090605@brainbot.com>
Hi all,
I have different user groups for my application, which have Windows in
different language-versions installed. Is there a possibilty to use the
win32-extensions language independent?
For example look at:
Windows, english version:
win32pdhutil.GetPerformanceAttributes('Process','ID Process',procname)
Windows, german version:
win32pdhutil.GetPerformanceAttributes('Prozess','ID Prozess',procname)
regards,
Thorsten
From janeaustine50 at hotmail.com Fri Sep 5 09:45:43 2003
From: janeaustine50 at hotmail.com (Austine Jane)
Date: Thu Sep 4 19:46:13 2003
Subject: [python-win32] Active Scripting in Python
Message-ID:
>From: Jeff Shannon
>To: python-win32@python.org
>CC: Austine Jane
>Subject: Re: [python-win32] Active Scripting in Python
>Date: Thu, 04 Sep 2003 13:26:54 -0700
>
>Austine Jane wrote:
>>I donwloaded win32all for Python 2.3 and installed it.
>>
>>I manually run pyscript.py and it returned "successfully registered"
>>message.
>>
>>For a simple test(on client side), I created the following html:
>>
>>
>>
>>And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
>>anything.
>
>Is this embedded within a full html page? (I.e., is it wrapped with at
>least tags?) If not, that may be the problem.
>
I tried them in a proper html page. Even with "print" instead of "alert" but
all to fail.
>Also, Python is much pickier than VB/Jscript about specifying the full
>namespace of objects. Where's this alert() coming from? You may need to
>specify it as belonging to the document or the application object.
>
Those htmls in demo directory don't work, either.
>Jeff Shannon
>Technician/Programmer
>Credit International
>
Thanks anyway.
Jane
_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
From janeaustine50 at hotmail.com Thu Sep 4 14:25:22 2003
From: janeaustine50 at hotmail.com (Austine Jane)
Date: Thu Sep 4 22:52:23 2003
Subject: [python-win32] Active Scripting in Python
Message-ID:
I donwloaded win32all for Python 2.3 and installed it.
I manually run pyscript.py and it returned "successfully registered"
message.
For a simple test(on client side), I created the following html:
And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
anything.
After googling, I tried "pyscript.py --debug" and the trace collector
shows:
Object with win32trace dispatcher created (object=None)
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
(IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None
Am I doing something stupid?
Jane
_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail
From dave at psys.org Fri Sep 5 06:58:48 2003
From: dave at psys.org (David W. Harks)
Date: Fri Sep 5 06:58:53 2003
Subject: [python-win32] Active Scripting in Python
In-Reply-To:
References:
Message-ID: <200309050558.48344.dave@psys.org>
On Thursday 04 September 2003 1:49 pm, Austine Jane expounded thusly:
> I donwloaded win32all for Python 2.3 and installed it.
>
> I manually run pyscript.py and it returned "successfully registered"
> message.
>
> For a simple test(on client side), I created the following html:
>
>
>
> And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
> anything.
>
> After googling, I tried "pyscript.py --debug" and the trace collector
> shows:
>
> Object with win32trace dispatcher created (object=None)
> in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
> (IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
> in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
> (IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None
>
> Am I doing something stupid?
>
> Jane
See:
http://mail.python.org/pipermail/tutor/2002-May/014482.html
pyscript.py registers Python as an Active Scripting agent -- that's a
*server-side* language. You'd need to run IIS and use:
<% LANGUAGE = Python %>
Then, if you access the pages *through the web server* you should be able to
use python scripts in the pages.
See also http://starship.python.net/crew/pirx/asp/py_asp.html for a Python/ASP
demo.
dave
--
David W. Harks http://dwblog.psys.org
From pythonwin at evpopov.com Wed Sep 10 17:10:30 2003
From: pythonwin at evpopov.com (popov)
Date: Wed Sep 10 10:10:48 2003
Subject: [python-win32] pb with string conversion to float and GetObject call
Message-ID: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
Here's a strange one:
print float('8.4')
Works as expected.
But:
import win32com.client
obj = win32com.client.GetObject ("winmgmts:")
print float('8.4')
Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
print line !
If you use '8,4' instead of '8.4', then it works (!). So it seems that some
locals have been modified here by the call to GetObject (without this call -
leaving only the import statement - the problem does not show up).
Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
the culprit is the winmgmts provider...
If someone could test this and let me know the results. Thx
My system: W2k Server english, python 2.3, pywin32 for python 2.3.
From Jim.Vickroy at noaa.gov Wed Sep 10 09:21:07 2003
From: Jim.Vickroy at noaa.gov (Jim Vickroy)
Date: Wed Sep 10 10:22:38 2003
Subject: [python-win32] pb with string conversion to float and GetObject
call
References: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
Message-ID: <3F5F3353.79959FBD@noaa.gov>
Hmm ... I can not duplicate this behavior on my Win 2k Professional system:
PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32.
Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see
'Help/About PythonWin' for further copyright information.
>>>
>>> print float('8.4')
8.4
>>> import win32com.client
>>> print float('8.4')
8.4
>>> obj = win32com.client.GetObject ("winmgmts:")
>>> print float('8.4')
8.4
>>>
popov wrote:
> Here's a strange one:
>
> print float('8.4')
>
> Works as expected.
> But:
>
> import win32com.client
> obj = win32com.client.GetObject ("winmgmts:")
> print float('8.4')
>
> Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
> print line !
> If you use '8,4' instead of '8.4', then it works (!). So it seems that some
> locals have been modified here by the call to GetObject (without this call -
> leaving only the import statement - the problem does not show up).
> Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
> the culprit is the winmgmts provider...
> If someone could test this and let me know the results. Thx
>
> My system: W2k Server english, python 2.3, pywin32 for python 2.3.
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
From pythonwin at evpopov.com Wed Sep 10 17:40:49 2003
From: pythonwin at evpopov.com (popov)
Date: Wed Sep 10 10:40:56 2003
Subject: [python-win32] pb with string conversion to float and GetObject
call
References: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
<3F5F3353.79959FBD@noaa.gov>
Message-ID: <002401c377a9$87345cc0$f901a8c0@galbedir>
Ok, thanks for the test.
I can explain the difference in behaviour: I think you have '.' as the
decimal symbol for numbers in your regional settings. I have ','. Indeed, if
I change it to '.', it works. But I think it's not a solution: I would like
to keep ',' as the decimal point AND have the code working.
I think an explanation of the behaviour is that in the chain call initiated
by the GetObject call from python, some code modify the local settings used
by the current thread to make it use the settings set at the computer level,
and not the settings that the python interpreter may have defined itself...
So, when the call get back to python, the local settings now say that the
decimal point is ',' on my computer, which make the conversion from '8.4' to
float fail.
----- Original Message -----
From: "Jim Vickroy"
To: "popov"
Cc:
Sent: Wednesday, September 10, 2003 4:21 PM
Subject: Re: [python-win32] pb with string conversion to float and GetObject
call
> Hmm ... I can not duplicate this behavior on my Win 2k Professional
system:
>
>
> PythonWin 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on
win32.
>
> Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) -
see
> 'Help/About PythonWin' for further copyright information.
> >>>
> >>> print float('8.4')
> 8.4
> >>> import win32com.client
> >>> print float('8.4')
> 8.4
> >>> obj = win32com.client.GetObject ("winmgmts:")
> >>> print float('8.4')
> 8.4
> >>>
>
>
>
> popov wrote:
>
> > Here's a strange one:
> >
> > print float('8.4')
> >
> > Works as expected.
> > But:
> >
> > import win32com.client
> > obj = win32com.client.GetObject ("winmgmts:")
> > print float('8.4')
> >
> > Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
> > print line !
> > If you use '8,4' instead of '8.4', then it works (!). So it seems that
some
> > locals have been modified here by the call to GetObject (without this
call -
> > leaving only the import statement - the problem does not show up).
> > Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So
maybe
> > the culprit is the winmgmts provider...
> > If someone could test this and let me know the results. Thx
> >
> > My system: W2k Server english, python 2.3, pywin32 for python 2.3.
> >
> > _______________________________________________
> > Python-win32 mailing list
> > Python-win32@python.org
> > http://mail.python.org/mailman/listinfo/python-win32
>
>
From outlook at evpopov.com Wed Sep 10 17:07:59 2003
From: outlook at evpopov.com (popov)
Date: Wed Sep 10 11:27:02 2003
Subject: [python-win32] pb with string conversion to float and GetObject call
Message-ID: <004501c377a4$f26b3540$f901a8c0@galbedir>
Here's a strange one:
print float('8.4')
Works as expected.
But:
import win32com.client
obj = win32com.client.GetObject ("winmgmts:")
print float('8.4')
Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
print line !
If you use '8,4' instead of '8.4', then it works (!). So it seems that some
locals have been modified here by the call to GetObject (without this call -
leaving only the import statement - the problem does not show up).
Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
the culprit is the winmgmts provider...
If someone could test this and let me know the results. Thx.
My system: W2k Server english, python 2.3, pywin32 for python 2.3.
From bgailer at alum.rpi.edu Wed Sep 10 10:42:29 2003
From: bgailer at alum.rpi.edu (Bob Gailer)
Date: Wed Sep 10 11:44:32 2003
Subject: [python-win32] pb with string conversion to float and
GetObject call
In-Reply-To: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
References: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
Message-ID: <6.0.0.22.0.20030910094201.03b67528@66.28.54.253>
Double-Hmm ... I can not duplicate this behavior on my Win 2k Server
:
At 08:10 AM 9/10/2003, popov wrote:
>Here's a strange one:
>
>print float('8.4')
>
>Works as expected.
>But:
>
>import win32com.client
>obj = win32com.client.GetObject ("winmgmts:")
>print float('8.4')
>
>Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
>print line !
>If you use '8,4' instead of '8.4', then it works (!). So it seems that some
>locals have been modified here by the call to GetObject (without this call -
>leaving only the import statement - the problem does not show up).
>Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
>the culprit is the winmgmts provider...
>If someone could test this and let me know the results. Thx
>
>My system: W2k Server english, python 2.3, pywin32 for python 2.3.
>
>
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003
Bob Gailer
bgailer@alum.rpi.edu
303 442 2625
-------------- next part --------------
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003
From pythonwin at evpopov.com Wed Sep 10 18:48:58 2003
From: pythonwin at evpopov.com (popov)
Date: Wed Sep 10 11:49:05 2003
Subject: [python-win32] pb with string conversion to float and GetObject
call
References: <001101c377a5$4b8b10a0$f901a8c0@galbedir>
<6.0.0.22.0.20030910094201.03b67528@66.28.54.253>
Message-ID: <003201c377b3$0d5b6290$f901a8c0@galbedir>
And by modifying the 'decimal point' used by numbers to be ',' (found in
your regional settings) ?
----- Original Message -----
From: "Bob Gailer"
To: "popov" ;
Sent: Wednesday, September 10, 2003 5:42 PM
Subject: Re: [python-win32] pb with string conversion to float and GetObject
call
> Double-Hmm ... I can not duplicate this behavior on my Win 2k Server
> :
> At 08:10 AM 9/10/2003, popov wrote:
>
> >Here's a strange one:
> >
> >print float('8.4')
> >
> >Works as expected.
> >But:
> >
> >import win32com.client
> >obj = win32com.client.GetObject ("winmgmts:")
> >print float('8.4')
> >
> >Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
> >print line !
> >If you use '8,4' instead of '8.4', then it works (!). So it seems that
some
> >locals have been modified here by the call to GetObject (without this
call -
> >leaving only the import statement - the problem does not show up).
> >Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So
maybe
> >the culprit is the winmgmts provider...
> >If someone could test this and let me know the results. Thx
> >
> >My system: W2k Server english, python 2.3, pywin32 for python 2.3.
> >
> >
> >
> >_______________________________________________
> >Python-win32 mailing list
> >Python-win32@python.org
> >http://mail.python.org/mailman/listinfo/python-win32
> >
> >
> >---
> >Incoming mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003
>
> Bob Gailer
> bgailer@alum.rpi.edu
> 303 442 2625
>
----------------------------------------------------------------------------
----
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.506 / Virus Database: 303 - Release Date: 8/1/2003
>
From Paul.Moore at atosorigin.com Wed Sep 10 17:49:21 2003
From: Paul.Moore at atosorigin.com (Moore, Paul)
Date: Wed Sep 10 11:50:13 2003
Subject: [python-win32] pb with string conversion to float and GetObject
call
Message-ID: <16E1010E4581B049ABC51D4975CEDB8803060C76@UKDCX001.uk.int.atosorigin.com>
From: popov [mailto:outlook@evpopov.com]
> Here's a strange one:
>
> print float('8.4')
>
> Works as expected.
> But:
>
> import win32com.client
> obj = win32com.client.GetObject ("winmgmts:")
> print float('8.4')
>
> Throws a 'ValueError: invalid literal for float(): 8.4' exception on the
> print line !
> If you use '8,4' instead of '8.4', then it works (!). So it seems that some
> locals have been modified here by the call to GetObject (without this call -
> leaving only the import statement - the problem does not show up).
> Note that using 'LDAP:' instead of 'winmgmts:', everything is ok. So maybe
> the culprit is the winmgmts provider...
> If someone could test this and let me know the results. Thx.
There's a discussion going on on python-dev at the moment (the messages
mention LC_NUMERIC in the subject) on basically this issue. Python's
float conversion routines rely on the underlying C locale remaining
unchanged. It's known that 3rd party extensions can violate this, and
also that Microsoft MAPI mucks up the locale behind the scenes. From
what you are reporting, it looks like the WMI stuff also does this.
I don't know of any fix for sure - you might be able to use the functions
from the locale module to set the locale value back to "C". Assuming that
an acceptable fix is found, something should be in Python 2.4 (I don't know
if the fix will be deemed appropriate for a maintenance release of 2.3).
Hope this helps,
Paul.
PS I'm copying this to python-dev, as evidence of another area where this
issue comes up - I hope that's acceptable.
From sds at qmaxtest.com Fri Sep 12 09:08:51 2003
From: sds at qmaxtest.com (S.D.Saravanan)
Date: Thu Sep 11 23:18:55 2003
Subject: [python-win32] Pythonwin32 source code
Message-ID: <000001c378d7$01168260$41967dc8@sdsaravanan>
Hai,
We need to build win32api module in debug.We have commanded out the three
lines from win32apimodule.cpp its building fine.Whether this procedure is
correct or not? Do we have to follow some other procedure to build it ?
PyDict_SetItemString(dict,"NameUnknown",PyInt_FromLong(NameUnknown));
PyDict_SetItemString(dict,"NameFullyQualifiedDN",PyInt_FromLong(NameFullyQua
lifiedDN));
PyDict_SetItemString(dict,"NameSamCompatible",PyInt_FromLong(NameSamCompatib
le));
PyDict_SetItemString(dict,"NameDisplay",PyInt_FromLong(NameDisplay));
PyDict_SetItemString(dict,"NameUniqueId",PyInt_FromLong(NameUniqueId));
PyDict_SetItemString(dict,"NameCanonical",PyInt_FromLong(NameCanonical));
//
PyDict_SetItemString(dict,"NameUserPrincipal",PyInt_FromLong(NameUserPrincip
al));
//
PyDict_SetItemString(dict,"NameCanonicalEx",PyInt_FromLong(NameCanonicalEx))
;
//
PyDict_SetItemString(dict,"NameServicePrincipal",PyInt_FromLong(NameServiceP
rincipal));
Thanks & Regards
S.D.Saravanan
From luther at terra.com.br Sat Sep 13 19:42:57 2003
From: luther at terra.com.br (=?iso-8859-1?Q?luther?=)
Date: Sat Sep 13 19:43:03 2003
Subject: [python-win32] Connection State on windows
Message-ID:
Hello all,
I'm trying to write a program that needs to be aware of the internet
connection state, if the computer is online or not. Well I have
searched the Universe for this, and I know that I have to make a call
to a function called InternetGetConnectedState wich is in the
wininet.dll, windows stuff. The problem is I can't find a way to do
this. I found a module named win32inet, but it is for python 2.0 and
I'm running 2.2
I'm getting crazy about this, can someone help me?
Thanks in advance
luther
From thorsten.henninger at brainbot.com Mon Sep 15 12:28:19 2003
From: thorsten.henninger at brainbot.com (Thorsten Henninger)
Date: Mon Sep 15 13:48:36 2003
Subject: [python-win32] Connection State on windows
In-Reply-To:
References:
Message-ID: <3F65E8A3.2090102@brainbot.com>
Hi.
why don't you just check this by sending a small request (e.g. ping) to
a server?
I guess that Windows doesn't does its connection state.
Thorsten
luther wrote:
>Hello all,
>
>I'm trying to write a program that needs to be aware of the internet
>connection state, if the computer is online or not. Well I have
>searched the Universe for this, and I know that I have to make a call
>to a function called InternetGetConnectedState wich is in the
>wininet.dll, windows stuff. The problem is I can't find a way to do
>this. I found a module named win32inet, but it is for python 2.0 and
>I'm running 2.2
>I'm getting crazy about this, can someone help me?
>
>Thanks in advance
>luther
>
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
>
>
From antone.heyward at verizon.net Mon Sep 15 19:58:29 2003
From: antone.heyward at verizon.net (antone)
Date: Mon Sep 15 19:57:48 2003
Subject: [python-win32] adding servers and workstations
Message-ID: <3F665225.2030907@verizon.net>
Is there native code in python32 i can use to add and remove machines to
and from a domain remotely. I wrote a gui around the netdom.exe that
comes with the support tools from MS which works fine. But i wanted to
distribute the app within the company without worring about legal sh%^.
From tony at tcapp.com Tue Sep 16 01:14:28 2003
From: tony at tcapp.com (Tony Cappellini)
Date: Tue Sep 16 01:17:48 2003
Subject: [python-win32] .py, .pyw extensions not associated with python,
pythonwin, after installing Python2.3/win32all-157
Message-ID: <5.1.0.14.0.20030915221006.01bbba20@smtp.sbcglobal.net>
After installing Python 2.3, and win32all-2.3, the green snake icons are
not associated with any .py and .pyw files, and therefor
double clicking does execute either.
This has happened on 2 different Win2k systems. I never had this problem
with Python 2.2, or win32all for Py2.2.
Has anyone else seen this problem ?
From theller at python.net Tue Sep 16 02:59:44 2003
From: theller at python.net (Thomas Heller)
Date: Tue Sep 16 02:59:24 2003
Subject: [python-win32] Re: Connection State on windows
References:
Message-ID:
"luther" writes:
> Hello all,
>
> I'm trying to write a program that needs to be aware of the internet
> connection state, if the computer is online or not. Well I have
> searched the Universe for this, and I know that I have to make a call
> to a function called InternetGetConnectedState wich is in the
> wininet.dll, windows stuff. The problem is I can't find a way to do
> this. I found a module named win32inet, but it is for python 2.0 and
> I'm running 2.2
> I'm getting crazy about this, can someone help me?
>
You need ctypes http://starship.python.net/crew/theller/ctypes/
from ctypes import *
from ctypes.wintypes import DWORD
wininet = windll.wininet
flags = DWORD()
connected = wininet.InternetGetConnectedState(byref(flags), None)
print connected, hex(flags.value)
This prints "1 0x12L" for me.
Thomas
From tim.golden at viacom-outdoor.co.uk Tue Sep 16 04:34:03 2003
From: tim.golden at viacom-outdoor.co.uk (Tim Golden)
Date: Tue Sep 16 04:39:37 2003
Subject: [python-win32] adding servers and workstations
Message-ID:
> -----Original Message-----
> From: antone [mailto:antone.heyward@verizon.net]
> Sent: 16 September 2003 00:58
> To: python32
> Subject: [python-win32] adding servers and workstations
>
>
> Is there native code in python32 i can use to add and remove
> machines to
> and from a domain remotely. I wrote a gui around the netdom.exe that
> comes with the support tools from MS which works fine. But i
> wanted to
> distribute the app within the company without worring about
> legal sh%^.
Googling around suggests that you want the NetJoinDomain API
call which doesn't appear to have been wrapped by any of the
win32 packages. It looks like quite a simple call:
http://msdn.microsoft.com/library/en-us/netmgmt/netmgmt/netjoindomain.asp
so the chances are it can be accessed by ctypes
http://starship.python.net/crew/theller/ctypes/
but I'll have to leave it to someone more capable than I am
with ctypes to confirm.
TJG
________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
From lehmanap at cs.purdue.edu Thu Sep 18 11:29:54 2003
From: lehmanap at cs.purdue.edu (Aaron Patrick Lehmann)
Date: Thu Sep 18 11:29:59 2003
Subject: [python-win32] Using an optional attribute of a method
Message-ID: <20030918152954.GA15800@lore.cs.purdue.edu>
Hey all--
I'm trying to use a method with optional arguments:
GetDefaultFolder(objsession, ObjectType [, mailbox])
This method works if I don't need to use the mailbox argument, but the
dynamic wrapper does not recognize the optional argument. Is there a way I
can make it recognize it?
Aaron Lehmann
--
Old hold for new construction. --Gene Ray www.timecube.com
From mark at easymailings.com Fri Sep 19 16:52:43 2003
From: mark at easymailings.com (Mark Bucciarelli)
Date: Fri Sep 19 17:08:41 2003
Subject: [python-win32] Service Question
Message-ID: <200309191652.43017.mark@easymailings.com>
I have a question about using Mark Hammonds win32 stuff, and I hope this is
the right list. If not, please tell me where to post. Thanks.
My question is this: I want to read the working directory and the service name
from an ini file when I install and then start the service. I'm using a
script that creates a win32process that starts python.
I'm trying to use a class variable to set the current working directory for
the service, like so:
class SimpleService(win32serviceutil.ServiceFramework):
_startdir_ = ''
[...]
def Start_SimpleService(self):
si=win32process.STARTUPINFO()
result=win32process.CreateProcess(
None,
'%s %s' % (INTERPRETER,
os.path.join(self._startdir_, SERVER)),
None,
None,
0,
0,
None,
self._startdir_,
si)
self.hSched=result[0]
if __name__ == '__main__':
SimpleService._startdir_ = "c:\\somedir"
win32serviceutil.HandleCommandLine(SimpleService)
but it doesn't work. The value of the class variable is never changed from
it's initial value (the empty string).
Please cc me on any responses, as I am not subscribed.
Regards,
Mark
From sfarris at ll.mit.edu Tue Sep 23 09:49:32 2003
From: sfarris at ll.mit.edu (Steve Farris)
Date: Tue Sep 23 09:50:36 2003
Subject: [python-win32] Linking Python Libraries With GCC In WIndows XP
Using SWIG
Message-ID: <3F704F6C.4080308@ll.mit.edu>
I have generated a very basic SWIG example from a SWIG tutorial at
http://www.swig.org . This example compiles and
interfaces correctly with Python2.2.3 in RedHat Linux9.0. When I
attempt to compile and link this example with the gnu compiler in
Windows XP I am getting link errors indicating the python libraries are
not included even though I have included the Python include headers in
the compile-stage, and the Python library python22.LIB in the link stage.
For completeness I have included the SWIG example.c and example.i files
created below along with the Link errors I am seeing. Any suggestions as
to why the linker is not seeing the Python modules indicated in the
errors below? I am using prepackaged executables and libraries for
Python2.2.3, gcc, and SWIG1.3.13 (note: I tried this with SWIG1.3.19
with the same results).
Thanks-
Steve Farris
Note: The example below is taken directly from a SWIG Tutorial at the
http://www.swig.org web site.
/* File : example.c From a SWIG Tutorial*/
/* A global variable */
double Foo = 3.0;
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {
int g;
g = y;
while (x > 0) {
g = x;
x = y % x;
y = g;
}
return g;
}
/* File : example.i */
%module example
extern int gcd(int x, int y);
extern double Foo;
The process I am following for compiling and linking are as follows;
swig -python example.i
gcc -c -I\include example.c example_wrap.c
gcc -shared -L\libs\python22.LIB example.o example_wrap.o -o
examplemodule.so
The first two steps run correctly. The third step (linking) gives me
the following first few errors (there are several more, all similar to
these;
example_wrap.o(.text+0x338):example_wrap.c: undefined reference to
'_imp__PyString_FromString'
example_wrap.o(.text+0x44d):example_wrap.c: undefined reference to
'_imp__PyExc_NameError'
example_wrap.o(.text+0x454):example_wrap.c: undefined reference to
'_imp__PyErr_SetString'
example_wrap.o(.text+0x4c1):example_wrap.c: undefined reference to
'_imp__PyExc_NameError'
example_wrap.o(.text+0x4c8):example_wrap.c: undefined reference to
'_imp__PyErr_SetString'
example_wrap.o(.text+0x507):example_wrap.c: undefined reference to
'_imp__PyType_Type'
etc...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20030923/dbc39af7/attachment.html
From jens.jorgensen at tallan.com Tue Sep 23 10:19:37 2003
From: jens.jorgensen at tallan.com (Jens B. Jorgensen)
Date: Tue Sep 23 10:19:32 2003
Subject: [python-win32] Linking Python Libraries With GCC In WIndows XP
Using SWIG
In-Reply-To: <3F704F6C.4080308@ll.mit.edu>
References: <3F704F6C.4080308@ll.mit.edu>
Message-ID: <3F705679.8020304@tallan.com>
gcc ?shared ?L\libs\python22.LIB example.o example_wrap.o ?o
examplemodule.so
"-L" specifies a library path while "-l" tells it to link in a library. Try:
gcc ?shared example.o example_wrap.o \libs\python22.LIB ?o
examplemodule.so
Steve Farris wrote:
>
> I have generated a very basic SWIG example from a SWIG tutorial at
> http://www.swig.org . This example compiles and
> interfaces correctly with Python2.2.3 in RedHat Linux9.0. When I
> attempt to compile and link this example with the gnu compiler in
> Windows XP I am getting link errors indicating the python libraries
> are not included even though I have included the Python include
> headers in the compile-stage, and the Python library python22.LIB in
> the link stage.
>
> For completeness I have included the SWIG example.c and example.i
> files created below along with the Link errors I am seeing. Any
> suggestions as to why the linker is not seeing the Python modules
> indicated in the errors below? I am using prepackaged executables and
> libraries for Python2.2.3, gcc, and SWIG1.3.13 (note: I tried this
> with SWIG1.3.19 with the same results).
>
> Thanks-
>
> Steve Farris
>
> Note: The example below is taken directly from a SWIG Tutorial at the
>
> http://www.swig.org web site.
>
> /* File : example.c From a SWIG Tutorial*/
>
> /* A global variable */
>
> double Foo = 3.0;
>
> /* Compute the greatest common divisor of positive integers */
>
> int gcd(int x, int y) {
>
> int g;
>
> g = y;
>
> while (x > 0) {
>
> g = x;
>
> x = y % x;
>
> y = g;
>
> }
>
> return g;
>
> }
>
> /* File : example.i */
>
> %module example
>
> extern int gcd(int x, int y);
>
> extern double Foo;
>
> The process I am following for compiling and linking are as follows;
>
> swig ?python example.i
>
> gcc ?c ?I\include example.c example_wrap.c
>
> gcc ?shared ?L\libs\python22.LIB example.o example_wrap.o
> ?o examplemodule.so
>
> The first two steps run correctly. The third step (linking) gives me
> the following first few errors (there are several more, all similar to
> these;
>
> example_wrap.o(.text+0x338):example_wrap.c: undefined reference to
> ?_imp__PyString_FromString?
>
> example_wrap.o(.text+0x44d):example_wrap.c: undefined reference to
> ?_imp__PyExc_NameError?
>
> example_wrap.o(.text+0x454):example_wrap.c: undefined reference to
> ?_imp__PyErr_SetString?
>
> example_wrap.o(.text+0x4c1):example_wrap.c: undefined reference to
> ?_imp__PyExc_NameError?
>
> example_wrap.o(.text+0x4c8):example_wrap.c: undefined reference to
> ?_imp__PyErr_SetString?
>
> example_wrap.o(.text+0x507):example_wrap.c: undefined reference to
> ?_imp__PyType_Type?
>
> etc?
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
>
--
Jens B. Jorgensen
jens.jorgensen@tallan.com
"With a focused commitment to our clients and our people, we deliver value through customized technology solutions."
From Paul.Moore at atosorigin.com Tue Sep 23 10:33:10 2003
From: Paul.Moore at atosorigin.com (Moore, Paul)
Date: Tue Sep 23 10:33:54 2003
Subject: [python-win32] Linking Python Libraries With GCC In WIndows
XPUsing SWIG
Message-ID: <16E1010E4581B049ABC51D4975CEDB8802C09787@UKDCX001.uk.int.atosorigin.com>
From: Steve Farris [mailto:sfarris@ll.mit.edu]
> (note: I tried this with SWIG1.3.19 with the same results).
I used swig 1.3.19 and Python 2.3.
> swig -python example.i
> gcc -c -I\include example.c example_wrap.c
No problem with these two
> gcc -shared -L\libs\python22.LIB example.o example_wrap.o -o examplemodule.so
Many problems here.
1. If you're using gcc (mingw, presumably, not cygwin???) with Python, you
need to generate a libpython22.a and put it in your \libs
directory. Instructions are in the Python documentation, "Installing
Python Modules", section 6.2.2. Run pexports then dlltool as shown.
2. -L sets the directory to search for libXXX.a when -lXXX is included.
You want -L\libs -lpython22.
3. The output module should be called _example.pyd, not examplemodule.so.
Are you looking at Unix-targetted instructions?
The following command line works:
gcc -shared -LC:\Apps\Python\libs example.o example_wrap.o -lpython22 -o _example.pyd
Hope this helps,
Paul.
From jtk at yahoo.com Fri Sep 26 12:15:05 2003
From: jtk at yahoo.com (Jeff Kowalczyk)
Date: Fri Sep 26 12:30:41 2003
Subject: [python-win32] minimal MS office addins, spambayes style
Message-ID:
I'm interested in bundling python code into office addins. I hope to get
rid of VBA for various object-model manipulation and data-normalization
functions that I often write to automate end-user tasks for particular
end-users. Reverting back to VBA for these types of scripts is painful
compared to what would be enjoyable python coding tasks.
The Spambayes Outlook plugin is extremely impressive and I would like to
emulate it, but its getting a bit daunting to factor out the minumum code
necessary for a non-graphical user function library. The module-level
functions from _DoRegister on down make plenty of sense, but I could use
some advice as to what subset of class OutlookAddin is minimally required
to access the Outlook object model.
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/spambayes/spambayes/Outlook2000/addin.py
Does anyone have any 'hello world' office addin samples along these lines?
I'm just looking to import the host object model, then expose a few
functions to the 'run macros' interface, or something equivalent.
I'd like to generalize the addin boilerplate code across other office Apps
supporting addins if I can, so I want to start with the simplest possible
python code and work my way up.
Thanks.
From pascor at hotpop.com Sat Sep 27 23:35:44 2003
From: pascor at hotpop.com (Ray Pasco)
Date: Sat Sep 27 23:35:52 2003
Subject: [python-win32] import case sensitivety ?
Message-ID: <3F765710.504@hotpop.com>
Suddenly import has decided to be case-sensitive (W98SE).
This is really twisting my brain since Windows ignores filenames' cases.
Could there be a setting somewhere that may have gotten stepped on ?
Any ideas will be appreciated.
From tony at tcapp.com Sun Sep 28 22:45:51 2003
From: tony at tcapp.com (Tony Cappellini)
Date: Sun Sep 28 22:49:03 2003
Subject: [python-win32] Icon associations stopped working with Python 2.3 on
Windows 2000
Message-ID: <5.1.0.14.0.20030928193500.01be3ab0@smtp.sbcglobal.net>
I have Python 2.3 and Win32All 1.57. Since I did this, none of the .py
files are associated with Python.exe (they don't show the green snake
icon). This has happened on 2 different systems.
So I have un-installed Py2.3, and Win32 1.57, and re-installed Python
2.2.3,and win32all 1.56 on my system (to be compatible with pyqt), but
still the associations do not work. However they worked fine with Py 2.2.2.
The fact that this has happened on more than one system concerns me.
From antone.heyward at verizon.net Sun Sep 28 23:02:49 2003
From: antone.heyward at verizon.net (antone)
Date: Sun Sep 28 23:01:54 2003
Subject: [python-win32] Icon associations stopped working with Python
2.3 on Windows 2000
In-Reply-To: <5.1.0.14.0.20030928193500.01be3ab0@smtp.sbcglobal.net>
References: <5.1.0.14.0.20030928193500.01be3ab0@smtp.sbcglobal.net>
Message-ID: <3F77A0D9.5020101@verizon.net>
Tony Cappellini wrote:
>
>
> I have Python 2.3 and Win32All 1.57. Since I did this, none of the .py
> files are associated with Python.exe (they don't show the green snake
> icon). This has happened on 2 different systems.
>
>
> So I have un-installed Py2.3, and Win32 1.57, and re-installed Python
> 2.2.3,and win32all 1.56 on my system (to be compatible with pyqt), but
> still the associations do not work. However they worked fine with Py
> 2.2.2.
>
> The fact that this has happened on more than one system concerns me.
>
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
You may want to go to "folder options" in explorer then to the "file
type" tab and check the settings for the py extension. You can change
the icon if you have to, it is usually placed in the ?:\python23 folder
as py.ico.
From tony at tcapp.com Mon Sep 29 00:15:47 2003
From: tony at tcapp.com (Tony Cappellini)
Date: Mon Sep 29 00:19:01 2003
Subject: [python-win32] Icon associations stopped working with
Python 2.3 on Windows 2000
In-Reply-To: <3F77A0D9.5020101@verizon.net>
References: <5.1.0.14.0.20030928193500.01be3ab0@smtp.sbcglobal.net>
<5.1.0.14.0.20030928193500.01be3ab0@smtp.sbcglobal.net>
Message-ID: <5.1.0.14.0.20030928211417.01bbe8b8@tcapp.com>
>>
> >>You may want to go to "folder options" in explorer then to the "file
> type" tab and check the settings for the py extension. You can
> change >>the icon if you have to, it is usually placed in the ?:\python23
> folder as py.ico.
Thanks Antone. I know how to restore the associations. The point I'm trying
to bring up is "Why does this only happen AFTER I installed and uninstalled
Py23, and Win32all 1.57, on two different systems ??
From amapy at snafu.de Mon Sep 29 04:24:47 2003
From: amapy at snafu.de (Andreas Maurer)
Date: Mon Sep 29 04:24:59 2003
Subject: [python-win32] Icon associations stopped working with
Message-ID:
>
> >>
> > >>You may want to go to "folder options" in explorer then to the "file
> > type" tab and check the settings for the py extension. You can
> > change >>the icon if you have to, it is usually placed in the ?:\python23
> > folder as py.ico.
>
>
> Thanks Antone. I know how to restore the associations. The point I'm trying
> to bring up is "Why does this only happen AFTER I installed and uninstalled
> Py23, and Win32all 1.57, on two different systems ??
>
>
Hi Tony,
what kind of installation did you choose?
Yo may choose between Admin-Install (python23.dll and some other files
are copied into %SystemRoot%\System32), file-associations are made for
All Users,
or
Non-Admin-Install (python23.dll will be put into ,
file-assocs are written into HKEY_CURRENT_USER hive.)
-> other users except install account can't see file-assocs
HTH
Andi
From sureshsubbiah at india.com Mon Sep 29 01:25:29 2003
From: sureshsubbiah at india.com (Sachin S.Suresh)
Date: Mon Sep 29 10:03:51 2003
Subject: [python-win32] Urgent Help reg DLLs
Message-ID: <20030929052529.19357.qmail@india.com>
hi all,
I'm developing our tool using python 2.2.2.
I need to use a function which is defined a seperate DLL file named "common.dll". My problem is, i need to create an object for a class which is in the DLL file to access the member function of that class in DLL.
The Structure of Class in DLL is,
class Common
{
int Result;
int ToServer(address,message);
}.
Thatz it. I need to access that member funcion ToServer.
Plz help me out in this case. Its a bit urgent.
Expecting useful stuff from all of u group mates.
Thanx a lot in advance !
Keeeeeeeeeeep (s)mailing
Sachin S.Suresh
"A diamond is just another piece of coal that did well under pressure"
--
______________________________________________
http://www.india.com
Now with POP3/SMTP access for only US$14.95/yr
Powered by Outblaze
From Samuel.Lacas at trusted-logic.fr Mon Sep 29 10:12:40 2003
From: Samuel.Lacas at trusted-logic.fr (Samuel Lacas)
Date: Mon Sep 29 10:12:45 2003
Subject: [python-win32] error in win32com source ?
Message-ID: <20030929161240.A25782@ouessant.trusted-logic.fr>
Hello,
I don't know whether it is an error or there is a reason behind this,
but I wonder about the following: in the RegisterClasses function of
the win32com.server.register module, we have this line (371st for me):
addnPath = None
According to the documentation (see RegisterServer earlier in the
module), this parameter should allow someone to provide an additional
search path for the server when registering it; but the previous line
obviously disables the feature.
Is there a reason for this ?
sL
From jens.jorgensen at tallan.com Mon Sep 29 10:50:59 2003
From: jens.jorgensen at tallan.com (Jens B. Jorgensen)
Date: Mon Sep 29 10:51:26 2003
Subject: [python-win32] Urgent Help reg DLLs
In-Reply-To: <20030929052529.19357.qmail@india.com>
References: <20030929052529.19357.qmail@india.com>
Message-ID: <3F7846D3.5050706@tallan.com>
You should be able to build a c++ extension dll that wraps the c++
class. The on-line documentation for Python includes a nice tutorial and
introduction for extending python (look under "Extending and
Embedding"). If you have the distutils module installed it is especially
easy. Let's say you want to call your new module pyCommonWrap. You
create a c++ source file calld pyCommonWrap.cpp like so:
#include
#include
PyObject *pyCommonWrap_ToServer(PyObject *self, PyObject *args)
{
char *address, *message;
// note that you didn't give complete type info for Common so I'm
assuming here that those
// args are both const char *
if (!PyArg_ParseTuple(args, "ss", &address, &message))
return NULL;
Common cmn;
int result = cmn.ToServer(address, message);
return PyInt_FromLong(result);
}
PyMethodDef pyCommonWrap_methods[] = {
{"ToServer", pyCommonWrap_ToServer, METH_VARARGS, "ToServer(address,
message) ==> result"},
{NULL, NULL}
};
extern "C" __declspec(dllexport)
void initpyCommonWrap(void)
{
Py_InitModule("pyCommonWrap", pyCommonWrap_methods);
}
And to make the compiling and all that easy (and supposing you have
distutils) you now create a python file named setup.py containing:
from distutils.core import setup, Extension
ext = Extension("pyCommonWrap", ["pyCommonWrap.cpp"])
setup(name = "pyCommonWrap", version = "0.1", description = "wrapper lib
for common.dll", ext_modules = [ext])
And now you're ready to compile your module:
python setup.py install
And that will build your module and install it into your python
site-packages sub-dir so you can find it. You can now test your module.
Invoke Python and type:
import pyCommonWrap
print pyCommonWrap.ToServer("an address", "a message")
That's the basics of it. Seriously though you should have considered
reading the fine manual before such a post as this. Anyway I haven't
tested any of the above, just typed it in, so naturally there will be
some tweaks necessary here and there.
Sachin S.Suresh wrote:
>hi all,
>I'm developing our tool using python 2.2.2.
>I need to use a function which is defined a seperate DLL file named "common.dll". My problem is, i need to create an object for a class which is in the DLL file to access the member function of that class in DLL.
>
>The Structure of Class in DLL is,
>
>class Common
>{
>
> int Result;
> int ToServer(address,message);
>}.
>
>Thatz it. I need to access that member funcion ToServer.
>Plz help me out in this case. Its a bit urgent.
>
>Expecting useful stuff from all of u group mates.
>
>Thanx a lot in advance !
>
>
>
>Keeeeeeeeeeep (s)mailing
>Sachin S.Suresh
>
>"A diamond is just another piece of coal that did well under pressure"
>
>
>
>
>
--
Jens B. Jorgensen
jens.jorgensen@tallan.com
"With a focused commitment to our clients and our people, we deliver value through customized technology solutions."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3108 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.python.org/pipermail/python-win32/attachments/20030929/900ddd9d/smime.bin
From lbates at syscononline.com Mon Sep 29 12:44:55 2003
From: lbates at syscononline.com (Larry Bates)
Date: Mon Sep 29 12:45:01 2003
Subject: [python-win32] Urgent Help reg DLLs
In-Reply-To:
Message-ID: <001f01c386a9$03c764e0$5d00a8c0@LABWXP>
You should check out:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847
This is a general purpose class wrapper for calling any
arbitrary .DLL (and associated functions in that .DLL).
I've used to it to call may different Windows .DLL files.
Good luck.
-Larry
------------------------------
Message: 5
Date: Mon, 29 Sep 2003 13:25:29 +0800
From: "Sachin S.Suresh"
Subject: [python-win32] Urgent Help reg DLLs
To: python-win32@python.org
Message-ID: <20030929052529.19357.qmail@india.com>
Content-Type: text/plain; charset="iso-8859-1"
hi all,
I'm developing our tool using python 2.2.2.
I need to use a function which is defined a seperate DLL file named
"common.dll". My problem is, i need to create an object for a class which is in
the DLL file to access the member function of that class in DLL.
The Structure of Class in DLL is,
class Common
{
int Result;
int ToServer(address,message);
}.
Thatz it. I need to access that member funcion ToServer.
Plz help me out in this case. Its a bit urgent.
Expecting useful stuff from all of u group mates.
Thanx a lot in advance !
Keeeeeeeeeeep (s)mailing
Sachin S.Suresh
"A diamond is just another piece of coal that did well under pressure"
--
______________________________________________
http://www.india.com
Now with POP3/SMTP access for only US$14.95/yr
Powered by Outblaze
------------------------------
Message: 6
Date: Mon, 29 Sep 2003 16:12:40 +0200
From: Samuel Lacas
Subject: [python-win32] error in win32com source ?
To: python-win32@python.org
Message-ID: <20030929161240.A25782@ouessant.trusted-logic.fr>
Content-Type: text/plain; charset=us-ascii
Hello,
I don't know whether it is an error or there is a reason behind this,
but I wonder about the following: in the RegisterClasses function of
the win32com.server.register module, we have this line (371st for me):
addnPath = None
According to the documentation (see RegisterServer earlier in the
module), this parameter should allow someone to provide an additional
search path for the server when registering it; but the previous line
obviously disables the feature.
Is there a reason for this ?
sL
------------------------------
Message: 7
Date: Mon, 29 Sep 2003 09:50:59 -0500
From: "Jens B. Jorgensen"
Subject: Re: [python-win32] Urgent Help reg DLLs
To: "Sachin S.Suresh"
Cc: python-win32@python.org
Message-ID: <3F7846D3.5050706@tallan.com>
Content-Type: text/plain; charset="iso-8859-1"
You should be able to build a c++ extension dll that wraps the c++
class. The on-line documentation for Python includes a nice tutorial and
introduction for extending python (look under "Extending and
Embedding"). If you have the distutils module installed it is especially
easy. Let's say you want to call your new module pyCommonWrap. You
create a c++ source file calld pyCommonWrap.cpp like so:
#include
#include
PyObject *pyCommonWrap_ToServer(PyObject *self, PyObject *args)
{
char *address, *message;
// note that you didn't give complete type info for Common so I'm
assuming here that those
// args are both const char *
if (!PyArg_ParseTuple(args, "ss", &address, &message))
return NULL;
Common cmn;
int result = cmn.ToServer(address, message);
return PyInt_FromLong(result);
}
PyMethodDef pyCommonWrap_methods[] = {
{"ToServer", pyCommonWrap_ToServer, METH_VARARGS, "ToServer(address,
message) ==> result"},
{NULL, NULL}
};
extern "C" __declspec(dllexport)
void initpyCommonWrap(void)
{
Py_InitModule("pyCommonWrap", pyCommonWrap_methods);
}
And to make the compiling and all that easy (and supposing you have
distutils) you now create a python file named setup.py containing:
from distutils.core import setup, Extension
ext = Extension("pyCommonWrap", ["pyCommonWrap.cpp"])
setup(name = "pyCommonWrap", version = "0.1", description = "wrapper lib
for common.dll", ext_modules = [ext])
And now you're ready to compile your module:
python setup.py install
And that will build your module and install it into your python
site-packages sub-dir so you can find it. You can now test your module.
Invoke Python and type:
import pyCommonWrap
print pyCommonWrap.ToServer("an address", "a message")
That's the basics of it. Seriously though you should have considered
reading the fine manual before such a post as this. Anyway I haven't
tested any of the above, just typed it in, so naturally there will be
some tweaks necessary here and there.
Sachin S.Suresh wrote:
>hi all,
>I'm developing our tool using python 2.2.2.
>I need to use a function which is defined a seperate DLL file named
"common.dll". My problem is, i need to create an object for a class which is in
the DLL file to access the member function of that class in DLL.
>
>The Structure of Class in DLL is,
>
>class Common
>{
>
> int Result;
> int ToServer(address,message);
>}.
>
>Thatz it. I need to access that member funcion ToServer.
>Plz help me out in this case. Its a bit urgent.
>
>Expecting useful stuff from all of u group mates.
>
>Thanx a lot in advance !
>
>
>
>Keeeeeeeeeeep (s)mailing
>Sachin S.Suresh
>
>"A diamond is just another piece of coal that did well under pressure"
>
>
>
>
>
--
Jens B. Jorgensen
jens.jorgensen@tallan.com
"With a focused commitment to our clients and our people, we deliver value
through customized technology solutions."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3108 bytes
Desc: S/MIME Cryptographic Signature
Url :
http://mail.python.org/pipermail/python-win32/attachments/20030929/900ddd9d/smim
e-0001.bin
------------------------------
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32
End of Python-win32 Digest, Vol 6, Issue 11
*******************************************
From jens.jorgensen at tallan.com Mon Sep 29 13:50:47 2003
From: jens.jorgensen at tallan.com (Jens B. Jorgensen)
Date: Mon Sep 29 13:50:59 2003
Subject: [python-win32] Urgent Help reg DLLs
In-Reply-To: <001f01c386a9$03c764e0$5d00a8c0@LABWXP>
References: <001f01c386a9$03c764e0$5d00a8c0@LABWXP>
Message-ID: <3F7870F7.8070402@tallan.com>
In this same vein there is another project, ctypes, which also aims to
provide a generalized solution to calling binary shared objects (dlls on
windows, .so on linux, etc.) which is pretty active and stable. You can
check it out at http://sourceforge.net/projects/ctypes/
I didn't suggest it here because if indeed you are calling a .dll that
comes from a C++ project and exports the actual objects and member
functions then you'll have to deal with c++ name "decoration" and
under-the-cover details about how objects get constructed, etc. which
are probably more trouble than they are worth. If the functions you're
calling are instead "bare" c functions then using the solution below or
cyptes would certainly be the easiest route to go.
Larry Bates wrote:
>You should check out:
>
>http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146847
>
>This is a general purpose class wrapper for calling any
>arbitrary .DLL (and associated functions in that .DLL).
>
>I've used to it to call may different Windows .DLL files.
>
>Good luck.
>
>-Larry
>
>------------------------------
>
>Message: 5
>Date: Mon, 29 Sep 2003 13:25:29 +0800
>From: "Sachin S.Suresh"
>Subject: [python-win32] Urgent Help reg DLLs
>To: python-win32@python.org
>Message-ID: <20030929052529.19357.qmail@india.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>hi all,
>I'm developing our tool using python 2.2.2.
>I need to use a function which is defined a seperate DLL file named
>"common.dll". My problem is, i need to create an object for a class which is in
>the DLL file to access the member function of that class in DLL.
>
>The Structure of Class in DLL is,
>
>class Common
>{
>
> int Result;
> int ToServer(address,message);
>}.
>
>Thatz it. I need to access that member funcion ToServer.
>Plz help me out in this case. Its a bit urgent.
>
>Expecting useful stuff from all of u group mates.
>
>Thanx a lot in advance !
>
>
>
>Keeeeeeeeeeep (s)mailing
>Sachin S.Suresh
>
>"A diamond is just another piece of coal that did well under pressure"
>
>
>
>--
>______________________________________________
>http://www.india.com
>Now with POP3/SMTP access for only US$14.95/yr
>
>Powered by Outblaze
>
>
>
>------------------------------
>
>Message: 6
>Date: Mon, 29 Sep 2003 16:12:40 +0200
>From: Samuel Lacas
>Subject: [python-win32] error in win32com source ?
>To: python-win32@python.org
>Message-ID: <20030929161240.A25782@ouessant.trusted-logic.fr>
>Content-Type: text/plain; charset=us-ascii
>
>Hello,
>
>I don't know whether it is an error or there is a reason behind this,
>but I wonder about the following: in the RegisterClasses function of
>the win32com.server.register module, we have this line (371st for me):
>
> addnPath = None
>
>According to the documentation (see RegisterServer earlier in the
>module), this parameter should allow someone to provide an additional
>search path for the server when registering it; but the previous line
>obviously disables the feature.
>
>Is there a reason for this ?
>
>sL
>
>
>
>------------------------------
>
>Message: 7
>Date: Mon, 29 Sep 2003 09:50:59 -0500
>From: "Jens B. Jorgensen"
>Subject: Re: [python-win32] Urgent Help reg DLLs
>To: "Sachin S.Suresh"
>Cc: python-win32@python.org
>Message-ID: <3F7846D3.5050706@tallan.com>
>Content-Type: text/plain; charset="iso-8859-1"
>
>You should be able to build a c++ extension dll that wraps the c++
>class. The on-line documentation for Python includes a nice tutorial and
>introduction for extending python (look under "Extending and
>Embedding"). If you have the distutils module installed it is especially
>easy. Let's say you want to call your new module pyCommonWrap. You
>create a c++ source file calld pyCommonWrap.cpp like so:
>
>#include
>#include
>
>PyObject *pyCommonWrap_ToServer(PyObject *self, PyObject *args)
>{
> char *address, *message;
> // note that you didn't give complete type info for Common so I'm
>assuming here that those
> // args are both const char *
> if (!PyArg_ParseTuple(args, "ss", &address, &message))
> return NULL;
>
> Common cmn;
> int result = cmn.ToServer(address, message);
>
> return PyInt_FromLong(result);
>}
>
>PyMethodDef pyCommonWrap_methods[] = {
> {"ToServer", pyCommonWrap_ToServer, METH_VARARGS, "ToServer(address,
>message) ==> result"},
> {NULL, NULL}
>};
>
>extern "C" __declspec(dllexport)
>void initpyCommonWrap(void)
>{
> Py_InitModule("pyCommonWrap", pyCommonWrap_methods);
>}
>
>
>And to make the compiling and all that easy (and supposing you have
>distutils) you now create a python file named setup.py containing:
>
>from distutils.core import setup, Extension
>
>ext = Extension("pyCommonWrap", ["pyCommonWrap.cpp"])
>
>setup(name = "pyCommonWrap", version = "0.1", description = "wrapper lib
>for common.dll", ext_modules = [ext])
>
>And now you're ready to compile your module:
>
>python setup.py install
>
>And that will build your module and install it into your python
>site-packages sub-dir so you can find it. You can now test your module.
>Invoke Python and type:
>
>import pyCommonWrap
>
>print pyCommonWrap.ToServer("an address", "a message")
>
>
>That's the basics of it. Seriously though you should have considered
>reading the fine manual before such a post as this. Anyway I haven't
>tested any of the above, just typed it in, so naturally there will be
>some tweaks necessary here and there.
>
>
>Sachin S.Suresh wrote:
>
>
>
>>hi all,
>>I'm developing our tool using python 2.2.2.
>>I need to use a function which is defined a seperate DLL file named
>>
>>
>"common.dll". My problem is, i need to create an object for a class which is in
>the DLL file to access the member function of that class in DLL.
>
>
>>The Structure of Class in DLL is,
>>
>>class Common
>>{
>>
>> int Result;
>> int ToServer(address,message);
>>}.
>>
>>Thatz it. I need to access that member funcion ToServer.
>>Plz help me out in this case. Its a bit urgent.
>>
>>Expecting useful stuff from all of u group mates.
>>
>>Thanx a lot in advance !
>>
>>
>>
>>Keeeeeeeeeeep (s)mailing
>>Sachin S.Suresh
>>
>>"A diamond is just another piece of coal that did well under pressure"
>>
>>
>>
>>
>>
>>
>>
>
>--
>Jens B. Jorgensen
>jens.jorgensen@tallan.com
>
>"With a focused commitment to our clients and our people, we deliver value
>through customized technology solutions."
>
>-------------- next part --------------
>A non-text attachment was scrubbed...
>Name: smime.p7s
>Type: application/x-pkcs7-signature
>Size: 3108 bytes
>Desc: S/MIME Cryptographic Signature
>Url :
>http://mail.python.org/pipermail/python-win32/attachments/20030929/900ddd9d/smim
>e-0001.bin
>
>------------------------------
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
>
>End of Python-win32 Digest, Vol 6, Issue 11
>*******************************************
>
>
>
>_______________________________________________
>Python-win32 mailing list
>Python-win32@python.org
>http://mail.python.org/mailman/listinfo/python-win32
>
>
--
Jens B. Jorgensen
jens.jorgensen@tallan.com
"With a focused commitment to our clients and our people, we deliver value through customized technology solutions."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3108 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.python.org/pipermail/python-win32/attachments/20030929/29da8bbd/smime.bin
From felix_mcallister at hotmail.com Tue Sep 30 04:39:49 2003
From: felix_mcallister at hotmail.com (Felix McAllister)
Date: Tue Sep 30 04:39:53 2003
Subject: [python-win32] win32traceutil doesn't work in Win32 service when
connected via Terminal Service
Message-ID:
Hi,
We have a Python service that periodically prints trace information using
print statements. The service uses the win32traceutil module so that print
output can be viewed using win32traceutil.py. This works fine, except for
the case when we connect to the server via Microsoft Terminal Services. In
that case, we don't see any trace output from the service, although the
trace output of other non-service Python apps is fine.
Ideas anyone?
Felix.
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail