Re: [python-win32] Python COM

2008-07-31 Thread Tim Golden

birdprince wrote:
I have implemented a COM in C++,buy i don't know how to use this COM 
in python. 
For example: the COM's ProgID is "MyCOM1.AdvMethod".this COM have two 
interfaces,the default interface's name is IAdvMethod,the second 
interface's name is IBasicMethod.
I use this method to call the IAdvMethod's method,because IAdvMethod is the 
default interface

code example:
import win32com.client 
moncom = win32com.client.Dispatch('MyCOM1.AdvMethod') 
moncom.IAdvMethod(... 

who can tell me how to call the IBasicMethod's method?Thank you very much! 


Well that looks like 3 emails in a few hours. And to the same
list. Remarkable.

In general, the win32com from pywin32 can't handle arbitrary
non-Dispatch interfaces. 


Try comtypes: http://sourceforge.net/projects/comtypes

TJG
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] IronPython COM

2008-07-31 Thread Tim Roberts

birdprince wrote:
I have implemented a COM in C++,buy i don't know how to use this COM 
in IronPython. 
  


The technical details of IronPython are quite different from CPython.
To talk COM, you have to use a magic subsystem called "Interop" that the
people on this list will probably not know.  I suggest you sign up for
the IronPython mailing list here:

   http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

It only gets a few messages a day.

--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Python and COM

2008-07-31 Thread Tim Roberts

birdprince wrote:
I have implemented a COM in C++,buy i don't know how to use this COM 
in python. 
For example: the COM's ProgID is "MyCOM1.AdvMethod".this COM have two 
interfaces,the default interface's name is IAdvMethod,IAdvMethod have a method 
which name is Add,the second interface's name is IBasicMethod. IBasicMethod 
have a method which name is Sub.All the interface are based on IDispatch.


who can tell me how to call the Add and Sub successful.


Have you read any of the documentation or any of the samples on using 
COM from Python?  My guess is no.  If you have, why don't you post what 
you tried and tell us what happened when you tried it?



Thank you very much,please answer my question in code.
  


Morse code?

--
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] Is this user a member of a given Active Directory group?

2008-07-31 Thread Vernon Cole
Dear group:
My company makes use of Active Directory to determine what rights a given
user has in an application system. If the user is a member of a certain
group, then (s)he has the right to perform some set of functions. For
example, if VCOLE is a member of WCPO-CREATE then I can create new purchase
orders.

The method I am using to determine a user's group membership consists of
looking at all the members of each target group, and finding whether my user
is on that list.
Something like the following code snippet:
v v v v v v
glist = ['A','List',"of","possible",'group','names']
_username = win32api.GetUserName().upper()
_LoginServer = win32net.NetGetAnyDCName()

if True: # begin snippet
groups = set()
for g in glist:
resume = 0
while True:
try:
entries, total, resume = \
 win32net.NetGroupGetUsers(
 _LoginServer,g, 0, resume)
except KeyboardInterrupt:
raise
except:
print 'Group Name "%s" could not be found' % g
break
for de in entries:
name = de['name'].upper()
if name == _username:
groups.add(g)
if resume == 0:
break
# end snippet
if 'possible' in groups:
   print 'You can do it.'
^ ^ ^ ^ ^
My question is this:
  There MUST be some better way. Is there no system call for "Is user U a
member of group G"?
--
Vernon Cole
___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] when was pythonwin develop?

2008-07-31 Thread Emanuel Sotelo

hello, everybody
perhaps somebody already ask this question but a i dont now the answer

at what year was pythonwin develop, or at what year was his first release?

is Mark Hammond the creator of pythonwin or was someone else?

who help at the develoment of pythonwin?


i hope some can help me aswer this questions.

_
Los mejores conciertos en exclusiva por MSN in concert
http://video.msn.com/?mkt=es-mx___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] pywin32 build 212 released

2008-07-31 Thread Mark Hammond
Hi all,
  I'm happy to announce the release of pywin32 build 212

This is a fairly minor release, with fixes to the few issues found since
build 211, plus a few other minor additions (as usual, many contributed by
Roger Upole.)  The full change notes are at
https://sourceforge.net/project/shownotes.php?release_id=616849

Get it now via https://sourceforge.net/project/showfiles.php?group_id=78018

Thanks to everyone who contributed, reported bugs, etc.

Cheers,

Mark


___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] pywin32 build 212 released

2008-07-31 Thread Michel Claveau

Hello!


I'm happy to announce the release of pywin32 build 212


I'm happy to thank Mark, for that.



Michel Claveau

___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


[python-win32] py2exe bug with email.MIMEText

2008-07-31 Thread Marcus.CM
There is a bug with py2exe when (at least under windows) when importing 
email


# example testmime.py
import email
msg = email.MIMEText.MIMEText("dsafdafdasfA")
print "ok"

1. Save the text above and setup as testmime.py
2. Run it and u can see "ok"
3. Create setup.py and run :  python setup.py py2exe
4. Run the testmime.exe and u will get error "Import error : No module 
name text"


# Example setup.py
from distutils.core import setup
import py2exe
setup(console=['testmime.py'])

Anyone knows the fix for this?



___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] py2exe bug with email.MIMEText

2008-07-31 Thread Marcus.CM

Hi,

After some debugging, i found the solution is to :-

import email
import email.mime.text
import email.iterators
import email.generator
import email.utils

Marcus.


Marcus.CM wrote:
There is a bug with py2exe when (at least under windows) when 
importing email


# example testmime.py
import email
msg = email.MIMEText.MIMEText("dsafdafdasfA")
print "ok"

1. Save the text above and setup as testmime.py
2. Run it and u can see "ok"
3. Create setup.py and run :  python setup.py py2exe
4. Run the testmime.exe and u will get error "Import error : No module 
name text"


# Example setup.py
from distutils.core import setup
import py2exe
setup(console=['testmime.py'])

Anyone knows the fix for this?



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




___
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32