From skippy.hammond at gmail.com Mon Jul 1 04:41:29 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 01 Jul 2013 12:41:29 +1000 Subject: [python-win32] New win32com.client.VARIANT object In-Reply-To: <201306221559159250034@naen-china.com> References: <201306221559159250034@naen-china.com> Message-ID: <51D0EC59.1010008@gmail.com> It is in the latest pywin32 build from sourceforge.net/prjects/pywin32 - I'm not sure what the current version of ActivePython includes. Also, note that it is not a module, it's an object in the win32com.client module. Mark On 22/06/2013 5:59 PM, feng.xu wrote: > Dear Mark: > Where can i get this VARIANT module? it seems that i have issue you > described in the email. > I cannot find this module in the activate python 2.7 > Thank you very much. > ------------------------------------------------------------------------ > feng.xu > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From skippy.hammond at gmail.com Mon Jul 1 04:53:17 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Mon, 01 Jul 2013 12:53:17 +1000 Subject: [python-win32] Passing Args through PythonService.exe In-Reply-To: References: Message-ID: <51D0EF1D.5030305@gmail.com> On 21/06/2013 6:06 AM, Michael Manfre wrote: > Is it possible to pass args through PythonService.exe on to the > ServiceFramework class? The only arg that I ever see come through the > init is a tuple containing only the _svc_name_. I need to install many > services for celery workers and having to create a separate class/file > for each environment and queue combination would be painful. > > I started to dig in to PythonService.cpp, but have yet to find any way > of controlling what argv will used with the init. pythonservice does set sys.argv (see PyService_InitPython() in PythonService.cpp) - but note that windows has pretty poor support for service command-lines in general - eg, setting "arguments" in the control panel applet doesn't persist those arguments - they are one-shot (eg, so it's not uncommon for services to manually persist these values in the registry when they are seen) So I suspect you simply aren't seeing the service started with the command-line args you expect... Mark From skippy.hammond at gmail.com Tue Jul 9 06:42:48 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Tue, 09 Jul 2013 14:42:48 +1000 Subject: [python-win32] Building pywin32 msi installers In-Reply-To: <75BADF2D5A2DD345819BDC79C664DA4D2124FF@Exchange2010.nameconnector.com> References: <75BADF2D5A2DD345819BDC79C664DA4D20F136@Exchange2010.nameconnector.com> <51C2AC1B.8020703@gmail.com> <75BADF2D5A2DD345819BDC79C664DA4D2124FF@Exchange2010.nameconnector.com> Message-ID: <51DB94C8.7030601@gmail.com> [oops - sorry for the delay] On 22/06/2013 3:03 AM, Will Sadkin wrote: > On 20/06/2013 3:16 AM , Mark Hammond wrote: > >> I've wanted bdist_msi to work for ages. There was some issue with >> the install scripts that always caused grief, and my memory is hazy >> - it *might* be that the uninstall process doesn't run the >> post-install script at the correct time - ie, that it runs *after* >> the uninstall, which means pywin32 isn't available to undo some of >> the stuff it did as it can't import pywin32 itself. > > There's a comment in the pywin32_postinstall.py script that says: > elif arg == "-remove": # bdist_msi calls us before uninstall, so we > can undo what we # previously did. Sadly, bdist_wininst calls us > *after*, so # we can't do much at all. if not is_bdist_wininst: > uninstall() > > And I've confirmed that this comment re: bdist_msi is correct. Given > this, I expect that these issues were with the bdist_wininst, and so > a working msi installer might be even better than the existing > installer on that score. Awesome :) >> Another problem I'd expect to find is that the post-install script >> tries to tell distutils about new files and registry entries >> created at install time - this probably fails silently now (ie, it >> might *appear* to work but probably leaves trash behind.) > > I couldn't identify the code that does this thing you mention above, It's the file_created and directory_created methods at the top of pywin32_postinstall.py. > but given this concern, I did some careful checking. As far as I can > tell, there are 3 complaints re: trash: > > 1) What's left behind in the file system after an install followed by > an immediate uninstall are 3 site-packages subtrees: win32\lib, > win32com\{client,server,servers}, and win32comext\{axscript,shell}, > and all of these only contain .pyc files. Unfortunately, as .pycs > are generated post-install by the interpreter, and I'm not sure how > to identify the ones associated with just the pywin32 stuff, so I > don't quite know how to get rid of them so that these directories are > cleanly removed. Further, if the other directories installed get > invoked, I'm sure that there will be .pycs generated there too. Is > there a way to have the postinstall script know (without hardcoding), > which directories it should recursively clean out the .pycs from? Or > is there some other mechanism I can use that I'm not aware of? I'd think it's OK to be fairly aggressive about removing compiled files - so if the only solution we can come up with is to delete all .pyc/.pyo files from the pywin32 install dirs (which is a fixed set) I'd be inclined to say that's OK. > 2) There is also much black magic juju-bwana re: create_shortcut that > is in that script and I don't entirely understand... But running the > postinstall.py -install manually on windows 7, it says: > > Can't install shortcuts - > u'C:\\Users\\DevTest7\\AppData\\Roaming\\Microsoft\\Windows\\Start > Menu\\Programs\\Python 2.7' is not a folder. > > I don't yet know why it's trying to use this folder, but this whole > thing is part of the black magic I don't understand, and there are > comments in the postinstall script that suggest that none of this > stuff actually works on windows 7 anyway. Do we know if this step > actually works for win7 with the current installer? In theory, this is where a Python install done "for me" would have stuck the start menu items. > > 3) And on manually trying the -remove version of the script, it > complained: Failed to unregister Pythonwin: [Error 5] Access is > denied > > But I tracked this down to a bug in the uninstall code in the > postinstall.py script; _winreg.DeleteKey() doesn't allow you delete a > key with subkeys, but you had created two keys with (command) subkeys > in the install process. Once I fixed the postinstall script to > Delete the subkeys and then the root key, the script properly removed > the pythonwin.exe keys and unregistered it. (I suspect this is > actually currently broken in the regular installer as well if you use > the bdist_wininst distutils mechanism, unless that code is > circumvented in your .exe installer.) (I will supply a patch for > this too.) huh - I've never seen that before, but what you describe sounds very likely. > Should I be looking for anything else while I'm at it? The only thing that does come to mind is earlier Windows versions - if you have, eg, XP on a VM it's probably worth doing a test cycle there too. Similarly, testing when Python is installed "for me" or "for everyone" would be good (IIRC, that's disabled for Vista, but is enabled on Win7?) >>> 1) I couldn't build from the latest source version (218). [...] >> Yeah, I screwed that release up in that regard. I normally unzip >> the source package and attempt to build it before release, but >> forgot that time :( > > Ok, well, with luck, the changes to allow construction of an official > msi can become part of version 219. ;) > >> I have used the patch version in the past - mainly when I've found >> one single package was uploaded incorrectly due to a build issue >> rather than due to a bug in the code itself. eg: >> https://sourceforge.net/projects/pywin32/files/pywin32/Build216/ - >> where is a "216.1" build for Python 3.2. >> >> The other thing I've done in the past is to upload custom pywin32 >> builds for people when they've reported a bug but can't rebuild the >> world to test it - I usually change that version string immediately >> after release, so any such "interim" builds can't be confused with >> the official builds (but such builds don't end up on sourceforge) >> >> But I'm happy to change things in this area if it blocks support >> for MSI. The other thing I'd want to make sure is that the Python >> version in that number does something sane - eg, I wouldn't want >> the MSI infrastructure to think that "2.7.217" was an earlier >> version (or even related in any way) than "3.2.216" etc. > > Yeeeaaaahhh, the docstring on the strict version class says "the > rationale for this version string numbering system will be explained > in the distutils documentation," but no such rationale is provided > there. Further, here's a snippet of the bdist_msi.py code: > > version = metadata.get_version() # ProductVersion must be strictly > numeric # XXX need to deal with prerelease versions sversion = > "%d.%d.%d" % StrictVersion(version).version # Prefix ProductName with > Python x.y, so that # it sorts together with the other Python > packages # in Add-Remove-Programs (APR) fullname = > self.distribution.get_fullname() if self.target_version: product_name > = "Python %s %s" % (self.target_version, fullname) else: product_name > = "Python %s" % (fullname) > > This assumes that the StrictVersion(version).version is literally a > tuple of 3 components; otherwise the string format would generate an > exception; fortunately, if you don't provide the 3rd component, it > appends a 0 for you (see below). Also, the above code automatically > sticks "Python x.y" into the product name used, so I don't think we > need to include those in the version string like I was. > > From the distutils\version.py file: class StrictVersion (Version): > [...] version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? > ([ab](\d+))?$', re.VERBOSE) > > def parse (self, vstring): match = self.version_re.match(vstring) if > not match: raise ValueError, "invalid version number '%s'" % vstring > > (major, minor, patch, prerelease, prerelease_num) = \ match.group(1, > 2, 4, 5, 6) > > if patch: self.version = tuple(map(string.atoi, [major, minor, > patch])) else: self.version = tuple(map(string.atoi, [major, minor]) > + [0]) > > if prerelease: self.prerelease = (prerelease[0], > string.atoi(prerelease_num)) else: self.prerelease = None > > Given the code in bdist_msi using the current python release > major.minor release number already in the product name, this suggests > that we should just specify build_id as major, and your patch number > (usually .0) as minor in the version string. That way, you don't > have to change a thing with respect to versioning, and instead of my > previous patch, we can just use your build_id_patch variable as the > dist version, eg: > > dist = setup(name="pywin32", ! version=str(build_id), > description="Python for Window Extensions", long_description="Python > extensions for Microsoft Windows\n" "Provides access to much of the > Win32 API, the\n" "ability to create and use COM objects, and the\n" > "Pythonwin environment.", --- 2328,2340 ---- 'build_py' : > my_build_py, 'build_scripts' : my_build_scripts, } > > dist = setup(name="pywin32", ! # msi construction needs a > major.minor version, so we use build_id_patch ! # for this > instead: ! version=str(build_id_patch), description="Python for > Window Extensions", long_description="Python extensions for Microsoft > Windows\n" > > and that's the only change required in the setup file! > > This produces an msi named pywin32-217.0.win32-py2.7.msi, which also > (mostly) avoids the repetitive redundancy there too. Nice! >>> It turns out that this distutils bug was reported back in August >>> of 2012, and a patch has even been supplied (see >>> http://bugs.python.org/issue15797.) When I applied the supplied >>> patch, and rebuilt my msi, it properly ran the postinstall >>> script, and (as far as I can tell) the resulting install works >>> perfectly! >> >> I can probably help push that through. Although it seems unlikely >> for it to be accepted into the 2.x branch, which is a problem. >> OTOH though, if you help get this working and you only care about >> 3.x, I could certainly live with the fact that MSI installers are >> only available for 3.x... > > Regrettably, I need them for 2.7. > >> I wonder if there are heuristics the post-install script could use >> to work around this itself? You said the uninstall worked - did it >> actually leave a clean file-system afterwards? If so, it would >> seem the issue I mentioned before might not be a problem at all - >> but it's not clear to me how, even if pywin32 was fully unavailable >> at uninstall time, how we could determine if this invocation is for >> a re-install or an uninstall (ie, it's not clear to me that the >> absence of certain files would be a reliable guide here) > > Yeah, I thought about that, and struggled with the same issues: > without arguments, how would it know whether it was being invoked for > install or remove? But when I discovered what the real problem was, > and went a-googling, I discovered that bug report and patch > submission against the distutils, and so I thought that was the > better choice. If I can resolve the other issues, and submit > patches, is there any way I can convince you to to apply that > distutils patch on your system, so that you can then use it to build > the msi's? If they work and come from you, I suspect no one will > care that they were built with an "unsanctioned" version of > distutils... Sure, sounds fine. Really happy to see this moving :) Mark From mmanfre at gmail.com Wed Jul 10 17:12:53 2013 From: mmanfre at gmail.com (Michael Manfre) Date: Wed, 10 Jul 2013 11:12:53 -0400 Subject: [python-win32] Passing Args through PythonService.exe In-Reply-To: <51D0EF1D.5030305@gmail.com> References: <51D0EF1D.5030305@gmail.com> Message-ID: I installed the service with the args I wanted and they appeared where I expected to see them in the service's property dialog (next to the "Path to executable"). The problem I experienced was that no matter what args were provided, either installed with the service or provided with the one-off "start parameters", the sys.argv as seen by my code was a tuple containing the service's _svc_name_ as set by my win32serviceutil.ServiceFramework class. I've since given up on using PythonService.exe and am now using another mechanism. Regards, Michael Manfre On Sun, Jun 30, 2013 at 10:53 PM, Mark Hammond wrote: > On 21/06/2013 6:06 AM, Michael Manfre wrote: > >> Is it possible to pass args through PythonService.exe on to the >> ServiceFramework class? The only arg that I ever see come through the >> init is a tuple containing only the _svc_name_. I need to install many >> services for celery workers and having to create a separate class/file >> for each environment and queue combination would be painful. >> >> I started to dig in to PythonService.cpp, but have yet to find any way >> of controlling what argv will used with the init. >> > > pythonservice does set sys.argv (see PyService_InitPython() in > PythonService.cpp) - but note that windows has pretty poor support for > service command-lines in general - eg, setting "arguments" in the control > panel applet doesn't persist those arguments - they are one-shot (eg, so > it's not uncommon for services to manually persist these values in the > registry when they are seen) > > So I suspect you simply aren't seeing the service started with the > command-line args you expect... > > Mark > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leegold at fastmail.fm Thu Jul 11 08:19:29 2013 From: leegold at fastmail.fm (leegold) Date: Wed, 10 Jul 2013 23:19:29 -0700 Subject: [python-win32] Sending Keystrokes to Active Windows Message-ID: <1373523569.15080.140661254346066.040D5EBF@webmail.messagingengine.com> Hi, I have Python 3.3 installed on XP. I want to send keystrokes to Firefox. I've searched for an answer but my knowledge of Win32 was not enough to make it work. If there was a small example or link to a code snip i could try. Thank you. From reckoner at gmail.com Thu Jul 11 14:09:28 2013 From: reckoner at gmail.com (reckoner) Date: Thu, 11 Jul 2013 05:09:28 -0700 Subject: [python-win32] Sending Keystrokes to Active Windows (leegold) In-Reply-To: References: Message-ID: <51DEA078.7090400@gmail.com> Use dragonfly: https://code.google.com/p/dragonfly/ Then, (FocusWindow(title='firefox')+Key('c-t') ).execute() will open a new tab in firefox. good luck! From mc at mclaveau.com Thu Jul 11 23:49:00 2013 From: mc at mclaveau.com (Michel Claveau) Date: Thu, 11 Jul 2013 23:49:00 +0200 Subject: [python-win32] Sending Keystrokes to Active Windows In-Reply-To: <1373523569.15080.140661254346066.040D5EBF@webmail.messagingengine.com> References: <1373523569.15080.140661254346066.040D5EBF@webmail.messagingengine.com> Message-ID: Hi! Below an (little/partial) example... @-salutations -- Michel Claveau #------------------------------------------------------------------------------------- # -*- coding: utf-8 -*- import win32api,time,win32con def keyb(ch=None,shift=False,control=False,alt=False, delaik=0.02): for b in ch: c=b if (b>='A' and b<='Z') or shift: win32api.keybd_event(win32con.VK_SHIFT, 0, 0, 0) if b>='a' and b<='z': c=b.upper() if alt: win32api.keybd_event(win32con.VK_MENU, 0, 0, 0) time.sleep(0.250) if control: win32api.keybd_event(win32con.VK_CONTROL, 0, 0, 0) if isinstance(b,(int)): cord=b else: cord=ord(c) win32api.keybd_event(cord, 0, win32con.KEYEVENTF_EXTENDEDKEY | 0, 0) if delaik>0.0: time.sleep(delaik) win32api.keybd_event(cord, 0, win32con.KEYEVENTF_EXTENDEDKEY | win32con.KEYEVENTF_KEYUP, 0) if delaik>0.0: time.sleep(delaik) if control: win32api.keybd_event(win32con.VK_CONTROL, 0, win32con.KEYEVENTF_KEYUP, 0) if alt: win32api.keybd_event(win32con.VK_MENU, 0, win32con.KEYEVENTF_KEYUP, 0) time.sleep(0.05) if (b>='A' and b<='Z') or shift: win32api.keybd_event(win32con.VK_SHIFT, 0, win32con.KEYEVENTF_KEYUP, 0) time.sleep(5) #user has 5 sec for prepare a target-window keyb("AZERTYUIOP ") keyb("azertyuiop") keyb("\r") keyb("1234567890",shift=True) #shift == True for french keyboard keyb("\n") keyb("AAAAAAAAA\n") time.sleep(1) keyb("f",alt=True) # {Alt} F (ouvre menu ?) time.sleep(1) keyb([27,27]) # 2 x {Escape} #------------------------------------------------------------------------------------- ----- Original Message ----- From: "leegold" To: Sent: Thursday, July 11, 2013 8:19 AM Subject: [python-win32] Sending Keystrokes to Active Windows > Hi, > > I have Python 3.3 installed on XP. I want to send keystrokes to Firefox. > I've searched for an answer but my knowledge of Win32 was not enough to > make it work. If there was a small example or link to a code snip i > could try. Thank you. > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From aishwaryashiv at gmail.com Wed Jul 17 10:47:39 2013 From: aishwaryashiv at gmail.com (Aishwarya Sivakumar) Date: Wed, 17 Jul 2013 14:17:39 +0530 Subject: [python-win32] Passing string[] parameters to c# .NET function Message-ID: I have a C# .NET function bool myFunc(string cmd, params string[] arg); I?m trying to access this using win32com as given below: server.myFunc(?ABCD?, [[?true?]]), but always get Type mismatch error com_error: (-2147352571, 'Type mismatch.', None, 2) Am I missing something? What is the correct manner in which I can pass the arguments to this function? I?m totally new to win32com and hence need help with regards to this problem Regards, Aishwarya -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Jul 17 20:22:12 2013 From: timr at probo.com (Tim Roberts) Date: Wed, 17 Jul 2013 11:22:12 -0700 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: References: Message-ID: <51E6E0D4.5090303@probo.com> Aishwarya Sivakumar wrote: > > I have a C# .NET function bool myFunc(string cmd, params string[] > arg); I?m trying to access this using win32com as given below: > > server.myFunc(?ABCD?, [[?true?]]), but always get Type mismatch error > > com_error: (-2147352571, 'Type mismatch.', None, 2) > You're passing a list containing a list containing a string -- essentially string[][]. Have you tried it with only one set of brackets? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From aishwaryashiv at gmail.com Thu Jul 18 07:11:30 2013 From: aishwaryashiv at gmail.com (Aishwarya Sivakumar) Date: Thu, 18 Jul 2013 10:41:30 +0530 Subject: [python-win32] Passing string[] parameters to c# .NET function Message-ID: I tried ["true"], [["true"]], and some more combinations of tuples but everything gave type mismatch error. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Thu Jul 18 19:14:43 2013 From: timr at probo.com (Tim Roberts) Date: Thu, 18 Jul 2013 10:14:43 -0700 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: References: Message-ID: <51E82283.4090409@probo.com> Aishwarya Sivakumar wrote: > I tried ["true"], [["true"]], and some more combinations of tuples but everything gave type mismatch error. Unfortunately, in COM there are several ways to declare an array of strings, and not all of those ways are easy to generate in Python. Are you able to run makepy on this class? If so, you could look at the generated Python wrapper and tells us the type codes it discovered. That might help some of the Python COM experts come up with a recipe. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From vernondcole at gmail.com Fri Jul 19 16:51:43 2013 From: vernondcole at gmail.com (Vernon D. Cole) Date: Fri, 19 Jul 2013 08:51:43 -0600 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: <51E82283.4090409@probo.com> References: <51E82283.4090409@probo.com> Message-ID: Reaching to a .NET assembly from traditional ("non managed") code such as CPython is not easy. Have you looked at IronPython? It is true Python, but is an implementation written in .NET, so it interacts with .NET assemblies much more easily. (Unfortunately, it has no ability to talk to Pywin32 functions.) There is also a Python .NET project to call .NET routines from CPython -- but I don't personally know anything about it. -- On Thu, Jul 18, 2013 at 11:14 AM, Tim Roberts wrote: > Aishwarya Sivakumar wrote: > > I tried ["true"], [["true"]], and some more combinations of tuples but > everything gave type mismatch error. > > Unfortunately, in COM there are several ways to declare an array of > strings, and not all of those ways are easy to generate in Python. Are > you able to run makepy on this class? If so, you could look at the > generated Python wrapper and tells us the type codes it discovered. > That might help some of the Python COM experts come up with a recipe. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Jul 19 18:46:19 2013 From: timr at probo.com (Tim Roberts) Date: Fri, 19 Jul 2013 09:46:19 -0700 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: References: <51E82283.4090409@probo.com> Message-ID: <51E96D5B.1050906@probo.com> Vernon D. Cole wrote: > Reaching to a .NET assembly from traditional ("non managed") code such > as CPython is not easy. Well, based on the partial solution that he has so far, I'm assuming he has exported a COM object from his .NET code. At that point, it shouldn't be any different from any other COM server. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From blucountry at yahoo.com Tue Jul 23 12:21:13 2013 From: blucountry at yahoo.com (Hans Rakotomanga) Date: Tue, 23 Jul 2013 03:21:13 -0700 (PDT) Subject: [python-win32] Question: Who killed a windows service Message-ID: <1374574873.96253.YahooMailNeo@web141203.mail.bf1.yahoo.com> Hi, I have a pywin32 service running on a shared computer. Now and then it gets killed by another user, for good reason mostly, but I would like to ask the person who does this why he/she/it did it. Soooo, is there a way to extract this information and have the service write it in its logs ? :) I was hoping the stop event would have it. -- Thanks for your help -------------- next part -------------- An HTML attachment was scrubbed... URL: From aishwaryashiv at gmail.com Tue Jul 23 15:44:57 2013 From: aishwaryashiv at gmail.com (Aishwarya Sivakumar) Date: Tue, 23 Jul 2013 19:14:57 +0530 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: <51E96D5B.1050906@probo.com> References: <51E82283.4090409@probo.com> <51E96D5B.1050906@probo.com> Message-ID: Hi, Thanks, I could verify the same with IronPython. I was just curious if there was a solution using win32com. Also when i modified the function bool myFunc(string cmd, params object[] arg) I could give server.myFunc(?ABCD?, [?true?]) and the function is called properly. On Fri, Jul 19, 2013 at 10:16 PM, Tim Roberts wrote: > Vernon D. Cole wrote: > > Reaching to a .NET assembly from traditional ("non managed") code such > > as CPython is not easy. > > Well, based on the partial solution that he has so far, I'm assuming he > has exported a COM object from his .NET code. At that point, it > shouldn't be any different from any other COM server. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill at tutts.org Tue Jul 23 20:10:18 2013 From: bill at tutts.org (Bill Tutt) Date: Tue, 23 Jul 2013 14:10:18 -0400 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: References: <51E82283.4090409@probo.com> <51E96D5B.1050906@probo.com> Message-ID: What does myFunc (both the params string[] and params object[] version) look like in the generated .tlb (from regasm.exe /tlb) when viewed using OleView.exe? That ought to provide us with the biggest hint I would think. Bill On Tue, Jul 23, 2013 at 9:44 AM, Aishwarya Sivakumar < aishwaryashiv at gmail.com> wrote: > Hi, > Thanks, I could verify the same with IronPython. I was just curious if > there was a solution using win32com. Also when i modified the function > > bool myFunc(string cmd, params object[] arg) > > I could give server.myFunc(?ABCD?, [?true?]) and the function is called properly. > > > On Fri, Jul 19, 2013 at 10:16 PM, Tim Roberts wrote: > >> Vernon D. Cole wrote: >> > Reaching to a .NET assembly from traditional ("non managed") code such >> > as CPython is not easy. >> >> Well, based on the partial solution that he has so far, I'm assuming he >> has exported a COM object from his .NET code. At that point, it >> shouldn't be any different from any other COM server. >> >> -- >> Tim Roberts, timr at probo.com >> Providenza & Boekelheide, Inc. >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Wed Jul 24 05:57:34 2013 From: skippy.hammond at gmail.com (Mark Hammond) Date: Wed, 24 Jul 2013 13:57:34 +1000 Subject: [python-win32] Question: Who killed a windows service In-Reply-To: <1374574873.96253.YahooMailNeo@web141203.mail.bf1.yahoo.com> References: <1374574873.96253.YahooMailNeo@web141203.mail.bf1.yahoo.com> Message-ID: <51EF50AE.6020905@gmail.com> The Windows "system" event log should have this information. Mark On 23/07/2013 8:21 PM, Hans Rakotomanga wrote: > Hi, > > I have a pywin32 service running on a shared computer. Now and then it > gets killed by another user, for good reason mostly, but I would like to > ask the person who does this why he/she/it did it. > Soooo, is there a way to extract this information and have the service > write it in its logs ? :) > > I was hoping the stop event would have it. > > -- Thanks for your help > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > From aishwaryashiv at gmail.com Wed Jul 24 07:59:21 2013 From: aishwaryashiv at gmail.com (Aishwarya Sivakumar) Date: Wed, 24 Jul 2013 11:29:21 +0530 Subject: [python-win32] Passing string[] parameters to c# .NET function In-Reply-To: References: <51E82283.4090409@probo.com> <51E96D5B.1050906@probo.com> Message-ID: This is what i got from the OleView: HRESULT myFunc(string cmd, params object[] arg) [id(0x6002003a), vararg] HRESULT myFunc( [in] BSTR cmd, [in] SAFEARRAY(VARIANT) arg, [out, retval] VARIANT_BOOL* pRetVal); HRESULT myFunc(string cmd, params string[] arg) [id(0x6002003a)] HRESULT myFunc( [in] BSTR cmd, [in] SAFEARRAY(BSTR) arg, [out, retval] VARIANT_BOOL* pRetVal); On Tue, Jul 23, 2013 at 11:40 PM, Bill Tutt wrote: > What does myFunc (both the params string[] and params object[] version) > look like in the generated .tlb (from regasm.exe /tlb) when viewed using > OleView.exe? > > That ought to provide us with the biggest hint I would think. > > Bill > > > On Tue, Jul 23, 2013 at 9:44 AM, Aishwarya Sivakumar < > aishwaryashiv at gmail.com> wrote: > >> Hi, >> Thanks, I could verify the same with IronPython. I was just curious if >> there was a solution using win32com. Also when i modified the function >> >> bool myFunc(string cmd, params object[] arg) >> >> I could give server.myFunc(?ABCD?, [?true?]) and the function is called properly. >> >> >> On Fri, Jul 19, 2013 at 10:16 PM, Tim Roberts wrote: >> >>> Vernon D. Cole wrote: >>> > Reaching to a .NET assembly from traditional ("non managed") code such >>> > as CPython is not easy. >>> >>> Well, based on the partial solution that he has so far, I'm assuming he >>> has exported a COM object from his .NET code. At that point, it >>> shouldn't be any different from any other COM server. >>> >>> -- >>> Tim Roberts, timr at probo.com >>> Providenza & Boekelheide, Inc. >>> >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> http://mail.python.org/mailman/listinfo/python-win32 >>> >> >> >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> http://mail.python.org/mailman/listinfo/python-win32 >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blucountry at yahoo.com Wed Jul 24 11:29:26 2013 From: blucountry at yahoo.com (Hans Rakotomanga) Date: Wed, 24 Jul 2013 02:29:26 -0700 (PDT) Subject: [python-win32] Question: Who killed a windows service In-Reply-To: <51EF50AE.6020905@gmail.com> References: <1374574873.96253.YahooMailNeo@web141203.mail.bf1.yahoo.com> <51EF50AE.6020905@gmail.com> Message-ID: <1374658166.65674.YahooMailNeo@web141203.mail.bf1.yahoo.com> As far as I can see, event log only lists the source as Service Control Manager, no user info. Oh well, I'll just have to have it message me when it stops so I can restart it :) I've seen solutions where you need to install debug tools etc. But can't install those on a shared computer. Thanks anyhow guys. ________________________________ From: Mark Hammond To: Hans Rakotomanga ; "python-win32 at python.org" Sent: Wednesday, July 24, 2013 5:57 AM Subject: Re: [python-win32] Question: Who killed a windows service The Windows "system" event log should have this information. Mark On 23/07/2013 8:21 PM, Hans Rakotomanga wrote: > Hi, > > I have a pywin32 service running on a shared computer. Now and then it > gets killed by another user, for good reason mostly, but I would like to > ask the person who does this why he/she/it did it. > Soooo, is there a way to extract this information and have the service > write it in its logs ? :) > > I was hoping the stop event would have it. > > -- Thanks for your help > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.bohne at mevis.de Wed Jul 24 11:40:25 2013 From: andreas.bohne at mevis.de (Andreas B) Date: Wed, 24 Jul 2013 09:40:25 +0000 (UTC) Subject: [python-win32] Passing Args through PythonService.exe References: Message-ID: Hi, Michael Manfre gmail.com> writes: > > Is it possible to pass args through PythonService.exe on to the ServiceFramework class??The only arg that I ever see come through the init is a tuple containing only the _svc_name_.?I need to install many services for celery workers and having to create a separate class/file for each environment and queue combination would be painful.? > This works for me by setting the _exe_args_ class variable (similar to _svc_name_) in my service class (found in win32serviceutil.py). Regards, - Andreas From daniel.brugger at gmx.net Sun Jul 28 11:23:06 2013 From: daniel.brugger at gmx.net (lambda) Date: Sun, 28 Jul 2013 02:23:06 -0700 (PDT) Subject: [python-win32] WMPlayer.OCX COM object: player window is not opened Message-ID: <1375003386692-5026288.post@n6.nabble.com> I'm trying to instantiate and use a Windows Media Player COM object. I can do that and all seems fine, but the player window is not opened. Here's my code: I get the sound from this video, but no video window is shown. And in the process list I don't find a wmplayer.exe process, just a wmpnetwk.exe process (whereby I'm not sure if this process is related to my COM object). I played around a bit and found that actually opens a WMPlayer window; but that player can't be controlled by COM commands; and similar are ineffective. Maybe I'm just overlooking a silly detail, but I'm stuck on this - any help is appreciated! -- View this message in context: http://python.6.x6.nabble.com/WMPlayer-OCX-COM-object-player-window-is-not-opened-tp5026288.html Sent from the Python - python-win32 mailing list archive at Nabble.com.