From pingping124 at gmail.com Mon Aug 2 04:01:53 2010 From: pingping124 at gmail.com (Li Zhengping) Date: Mon, 2 Aug 2010 10:01:53 +0800 Subject: [python-win32] python-win32 Digest, Vol 88, Issue 12 In-Reply-To: References: Message-ID: Hi Guys, Is there anybody can help me about the processing taskbar ? How can I locate the cursor on the icon in the taskbar and double click it with python? There is a demo in the python example, for creating an icon in the taskbar for one task. Any idea about this is highly appreciated. Thanks. Zhengping 2010/7/27 > Send python-win32 mailing list submissions to > python-win32 at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/python-win32 > or, via email, send a message with subject or body 'help' to > python-win32-request at python.org > > You can reach the person managing the list at > python-win32-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of python-win32 digest..." > > > Today's Topics: > > 1. Possible to update exe file properties and/or icon via the > win32api library? (python at bdurham.com) > 2. Re: Possible to update exe file properties and/or icon via > the win32api library? (Tim Roberts) > 3. Re: Possible to update exe file properties and/or icon via > the win32api library? (Mark Hammond) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 26 Jul 2010 16:31:47 -0400 > From: python at bdurham.com > To: "zz Python Win32 Newsgroup" > Subject: [python-win32] Possible to update exe file properties and/or > icon via the win32api library? > Message-ID: <1280176307.6527.1386838237 at webmail.messagingengine.com> > Content-Type: text/plain; charset="us-ascii" > > Is it possible to update an exe file's properties and/or icon > file via the win32api library? By exe file properties I mean the > properties typically set via a resource file when an exe file is > created. Example properties are what one would see if they right > clicked on a file in Windows Explorer and chose the Properties > dialog. > > Sample exe file properties: > - product name > - product version > - product description > - copyright > - exe icon > Use case: We have a single exe whose file properties we would > like to customize for specific customers. > > An alternative question would be is there a way to update an > exe's file properties using an external resource file? > > Or would I be better off finding a Windows utility that might > allow me to script exe resource file updates? > > Thank you, > Malcolm > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: < > http://mail.python.org/pipermail/python-win32/attachments/20100726/db0f5c27/attachment-0001.html > > > > ------------------------------ > > Message: 2 > Date: Mon, 26 Jul 2010 13:48:32 -0700 > From: Tim Roberts > To: zz Python Win32 Newsgroup > Subject: Re: [python-win32] Possible to update exe file properties > and/or icon via the win32api library? > Message-ID: <4C4DF4A0.7080608 at probo.com> > Content-Type: text/plain; charset=ISO-8859-1 > > python at bdurham.com wrote: > > Is it possible to update an exe file's properties and/or icon file via > > the win32api library? By exe file properties I mean the properties > > typically set via a resource file when an exe file is created. Example > > properties are what one would see if they right clicked on a file in > > Windows Explorer and chose the Properties dialog. > > > > Sample exe file properties: > > - product name > > - product version > > - product description > > - copyright > > - exe icon > > > > Use case: We have a single exe whose file properties we would like to > > customize for specific customers. > > > > An alternative question would be is there a way to update an exe's > > file properties using an external resource file? > > > > Or would I be better off finding a Windows utility that might allow me > > to script exe resource file updates? > > > > There are many Resource Editors available on the web today that can > handle replacing resources in an existing executable, although there are > no APIs for doing so. See, for example, "resource hacker". > > There are many valid uses for having multiple external resource DLLs. > That's the way internationalization is often done. You have one > resource-only DLL for each language, and the main program looks up > resources there first. But if you want to change what Windows Explorer > shows, then you have little choice other than modifying the executable > file itself. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > > > ------------------------------ > > Message: 3 > Date: Tue, 27 Jul 2010 17:01:52 +1000 > From: Mark Hammond > To: python at bdurham.com > Cc: zz Python Win32 Newsgroup > Subject: Re: [python-win32] Possible to update exe file properties > and/or icon via the win32api library? > Message-ID: <4C4E8460.1040306 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 27/07/2010 6:31 AM, python at bdurham.com wrote: > > Is it possible to update an exe file's properties and/or icon file via > > the win32api library? > > Kinda - although it is pretty painful to use. To get started, check out > the 'verstamp.py' utility included with pywin32 and if you want to > update the icon etc, be prepared to read the win32 docs for > BeginUpdateResource etc and alot of experimentation (although digging > into the py2exe source code might be helpful there as it updates icons > and string resources using the same basic functions - although not via > pywin32) > > Cheers, > > Mark > > > ------------------------------ > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > > > End of python-win32 Digest, Vol 88, Issue 12 > ******************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From d_vineet at yahoo.com Wed Aug 4 08:30:42 2010 From: d_vineet at yahoo.com (Vineet Deodhar) Date: Tue, 3 Aug 2010 23:30:42 -0700 (PDT) Subject: [python-win32] running a python script on WinXP by icon double-clicking. Message-ID: <712451.64511.qm@web32008.mail.mud.yahoo.com> I have created a py2.6 script for a simple GUI with Tkinter. Saved it with .py extension and also as .pyw extension. filename is entry.py [CODE] from Tkinter import * from quitter import Quitter def fetch(): ??? print('Input => "%s"' % ent.get()) root = Tk() ent = Entry(root) ent.show='@' ent.insert(0, 'Type words here') ent.pack(side=TOP, fill=X) ent.focus() ent.bind('', (lambda event: fetch())) btn = Button(root, text='Fetch', command=fetch) btn.pack(side=LEFT) Quitter(root).pack(side=RIGHT) root.mainloop() [/CODE] 1) When run from command prompt as --- D:\py>python entry.py it runs nicely. 2) If I double-click on either entry.py or entry.pyw file, nothing happens (no DOS console window to show any error also). Any idea how should I run this with double-click on icon! Thanks, Vineet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gelonida at gmail.com Wed Aug 4 09:32:34 2010 From: gelonida at gmail.com (Gelonida) Date: Wed, 04 Aug 2010 09:32:34 +0200 Subject: [python-win32] running a python script on WinXP by icon double-clicking. In-Reply-To: <712451.64511.qm@web32008.mail.mud.yahoo.com> References: <712451.64511.qm@web32008.mail.mud.yahoo.com> Message-ID: On 08/04/2010 08:30 AM, Vineet Deodhar wrote: > I have created a py2.6 script for a simple GUI with Tkinter. > Saved it with .py extension and also as .pyw extension. > > filename is entry.py > [CODE] > from Tkinter import * > from quitter import Quitter > > def fetch(): > print('Input => "%s"' % ent.get()) > > root = Tk() > ent = Entry(root) > ent.show='@' > ent.insert(0, 'Type words here') > ent.pack(side=TOP, fill=X) > > ent.focus() > ent.bind('', (lambda event: fetch())) > btn = Button(root, text='Fetch', command=fetch) > btn.pack(side=LEFT) > Quitter(root).pack(side=RIGHT) > root.mainloop() > [/CODE] > > 1) When run from command prompt as --- > D:\py>python entry.py > it runs nicely. > > 2) If I double-click on either entry.py or entry.pyw file, > nothing happens (no DOS console window to show any error also). > Do you have any other python script that works by clicking on it? I assume, that you r windows file types are not registered correctly. Do you have multiple version of python installed? try following twwo commands to see whether windows was made aware of the python file types assoc .py assoc .pyw you should have received as answers .py=Python.File and .pyw=Python.NoConFile respectively if you don't see this just type: assoc .py=Python.File and assoc pyw=Python.NoConFile type also the command ftype Python.File you should see something like Python.NoConFile="C:\Python26\pythonw.exe" "%1" %* (depending where your py.exe is installed) perhaps this entry is wrong and points still to an executable that doesn't exist anymmore just type ftype Python.NoConFile="C:\Python26\pythonw.exe" "%1" %* (or with thy path to python.exe adapted) to fix it. then try the same with ftype Python.NoConFile > > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From d_vineet at yahoo.com Wed Aug 4 10:02:32 2010 From: d_vineet at yahoo.com (Vineet Deodhar) Date: Wed, 4 Aug 2010 01:02:32 -0700 (PDT) Subject: [python-win32] running a python script on WinXP by icon double-clicking. In-Reply-To: Message-ID: <7654.35528.qm@web32001.mail.mud.yahoo.com> Hi Kevin, I checked "Opens with" option for .py and .pyw files. Associations are correct. This problem happens for any python script file, not just this-one. Do I really need to remove & reinstall py26, or can there any other option ! ---Vineet. --- On Wed, 4/8/10, Kevin Horn wrote: From: Kevin Horn Subject: Re: [python-win32] running a python script on WinXP by icon double-clicking. To: "Vineet Deodhar" Date: Wednesday, 4 August, 2010, 12:11 First check that .py or .pyw files are associated with the proper executables. from an explorer window, choose Tools -> Folder Options then click on the file types tab find the PY and PYW entries in the list, and make sure their "Opens with" entries are correct PY -> python.exe PY -> pythonw.exe If those are correct, and you still have problems, then perhaps your python installation is messed up somehow, or there's something really strange about your script. Hope this helps, Kevin Horn On Wed, Aug 4, 2010 at 1:30 AM, Vineet Deodhar wrote: I have created a py2.6 script for a simple GUI with Tkinter. Saved it with .py extension and also as .pyw extension. filename is entry.py [CODE] from Tkinter import * from quitter import Quitter def fetch(): ??? print('Input => "%s"' % ent.get()) root = Tk() ent = Entry(root) ent.show='@' ent.insert(0, 'Type words here') ent.pack(side=TOP, fill=X) ent.focus() ent.bind('', (lambda event: fetch())) btn = Button(root, text='Fetch', command=fetch) btn.pack(side=LEFT) Quitter(root).pack(side=RIGHT) root.mainloop() [/CODE] 1) When run from command prompt as --- D:\py>python entry.py it runs nicely. 2) If I double-click on either entry.py or entry.pyw file, nothing happens (no DOS console window to show any error also). Any idea how should I run this with double-click on icon! Thanks, Vineet. _______________________________________________ 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 erik at softwaresociety.nl Wed Aug 4 10:46:34 2010 From: erik at softwaresociety.nl (Erik Oosterwaal) Date: Wed, 4 Aug 2010 10:46:34 +0200 Subject: [python-win32] Strange problems using Python inside Windows Script Components (WSC) Message-ID: <83C373B33E28C0459A9207E7077E1833E153B9@aristoteles.supportprofessionals.local> Hi All, I'm using Python inside a Windows Script Component (.wsc). I instantiate the WSC and call the code from classic ASP using VBscript. Now I'm running into a couple of problems: The standard ASP objects seem not to be available to Python in the WSC, even though the WSC has the implements ASP tag: I have a workaround for this; I pass an object to the WSC that has all of the standard IIS objects like request, response, session etc. as a property. Using that I -am- able to access the standard IIS objects, but it's obviously not an ideal solution. The code looks like this: def openGM(superObject): """places all of the projects and ASP objects into a global context so we can use it from inside the entire wsc.""" global request, response, application, session, translate, debug, usr, datatyping, dal, server request = superObject.Request response = superObject.Response application = superObject.Application session = superObject.Session ...etc The second problem I'm running into is debugging. Because I'm running the code from inside a WSC, which is in fact an active script component, the ASP page calling the WSC doesn't give me a descriptive error when there's something wrong in the WSC code. When developing in VBscript (at least locally), errors in the WSC will trigger Visual Studio, or another external debugger and allow me to debug the WSC code. PyScript doesn't seem to trigger anything. I have seen the axdebug module in the win32 extentions, but I have no idea how to implement this. Is it supposed to work out of the box, or is there something I need to do, to enable debugging from inside a WSC ? I have also tried importing win32traceutil, but that only seems to work for stdout. If I use the Python print() command from my WSC, the text will show up in the trace collector window, but errors don't. I was under the impression that both stdout and stderr were redirected to the trace collector? I have also seen suggstions around the Internet to use the --debug option when registering a component, but this is a script-component, and I use it exclusively without registration, using the getObject() function like so: set pythonwsc = GetObject("script:"&Server.MapPath("/components/python.wsc")) Does anyone perhaps have any tips or suggestions I might use to be able to debug in such a situation? The last problem I have, is a very strange one. The module I'm re-writing in Python is a translation module. What it does is read a bunch of XML data into a few dictionaries. It then writes those dictionaries (one for each supported language) into a file using Python's "shelve". This all works fine. I have a LoadData() function that checks if there already is a shelve file, if not it will load the XML (which is always present) and create the shelve file. If the file already exists, it wil just load the file and use the dictionaries inside, pretty simple. I have a global dictionary simply called "d" in my code, and after I fill or load it, it is available. Then I call the function to give me a translation for one of the dictionary keys, and all of a sudden "d" is empty. I have tried defining d outside of all of the functions in the WSC using d = {}, I have also tried defining d at the moment data is loaded or created using the gloabal keyword; "global d". Both methods didn't work. The workaround I have is to create a new global variable in the function that loads the dictionary and assigning d to that. Here's what that looks like: def loadDataFromDAT(filepath): response.write("Load data from .DAT file") translation_db = shelve.open(filepath) d = translation_db[str(usr.var("lcid"))] #response.write("
After loading data: " + str(d.keys())) global currentDictionary currentDictionary = d The strange thing is that d has values in this function, but when I call my "label()" function, which looks up a value for a key in the dictionary, it no longer has values, even though it is defined in another function as a global, or defined outside all of the functions (making it a global variable). If I then use "currentDictionary", it DOES have values. So the question is, what is the best way in a WSC to create a global variable, that works across functions inside the WSC? Thanks a lot for any answers or leads you guys can give me. The internet isn't exactly littered with information about Pyscrpt in WSC's I'm afraid, so I hope someone can shed some light on this. Kind regards, Erik -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Aug 4 18:56:21 2010 From: timr at probo.com (Tim Roberts) Date: Wed, 4 Aug 2010 09:56:21 -0700 Subject: [python-win32] running a python script on WinXP by icon double-clicking. In-Reply-To: <712451.64511.qm@web32008.mail.mud.yahoo.com> References: <712451.64511.qm@web32008.mail.mud.yahoo.com> Message-ID: <4C599BB5.7050802@probo.com> Vineet Deodhar wrote: > I have created a py2.6 script for a simple GUI with Tkinter. > Saved it with .py extension and also as .pyw extension. > ... > 1) When run from command prompt as --- > D:\py>python entry.py > it runs nicely. > > 2) If I double-click on either entry.py or entry.pyw file, > nothing happens (no DOS console window to show any error also). > > Any idea how should I run this with double-click on icon! > > Does it run if you type just the file name? For example: D:\py>entry.py or D:\py>entry.pyw If it runs like that, then it should run from a double-click. Do you have multiple versions of Python installed? Is "Quitter.py" in the same directory as the script? Can you check the associations from a command line using the assoc and ftype commands, like this: C:\tmp>assoc .py .py=Python.File C:\tmp>assoc .pyw .pyw=Python.NoConFile C:\tmp>ftype python.file python.file="C:\Apps\Python26\python.exe" "%1" %* C:\tmp>ftype python.noconfile python.noconfile="C:\Apps\Python26\pythonw.exe" "%1" %* Your path will probably be different, but the philosophy should be the same. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From gelonida at gmail.com Thu Aug 5 09:04:58 2010 From: gelonida at gmail.com (Gelonida) Date: Thu, 05 Aug 2010 09:04:58 +0200 Subject: [python-win32] running a python script on WinXP by icon double-clicking. In-Reply-To: <7654.35528.qm@web32001.mail.mud.yahoo.com> References: <7654.35528.qm@web32001.mail.mud.yahoo.com> Message-ID: Hi Vineet, Could you please post the output of the ftype and the assoc commands? As Tim asked in his post: Could you try to start the script from a command prompt without the preceding python command? So instead of typing: python entry.py just type entry.py tell us what happens On 08/04/2010 10:02 AM, Vineet Deodhar wrote: > Hi Kevin, > I checked "Opens with" option for .py and .pyw files. > Associations are correct. > > This problem happens for any python script file, not just this-one. > Do I really need to remove & reinstall py26, or can there any other option ! > > ---Vineet. > > > > --- On Wed, 4/8/10, Kevin Horn wrote: > > From: Kevin Horn > Subject: Re: [python-win32] running a python script on WinXP by icon double-clicking. > To: "Vineet Deodhar" > Date: Wednesday, 4 August, 2010, 12:11 > > First check that .py or .pyw files are associated with the proper executables. > > from an explorer window, choose Tools -> Folder Options > then click on the file types tab > > find the PY and PYW entries in the list, and make sure their "Opens with" entries are correct > > > PY -> python.exe > PY -> pythonw.exe > > If those are correct, and you still have problems, then perhaps your python installation is messed up somehow, > or there's something really strange about your script. > > > Hope this helps, > Kevin Horn > > On Wed, Aug 4, 2010 at 1:30 AM, Vineet Deodhar wrote: > > I have created a py2.6 script for a simple GUI with Tkinter. > Saved it with .py extension and also as .pyw extension. > > > filename is entry.py > [CODE] > from Tkinter import * > from quitter import Quitter > > def fetch(): > print('Input => "%s"' % ent.get()) > > root = Tk() > ent = Entry(root) > ent.show='@' > > ent.insert(0, 'Type words here') > ent.pack(side=TOP, fill=X) > > ent.focus() > ent.bind('', (lambda event: fetch())) > btn = Button(root, text='Fetch', command=fetch) > btn.pack(side=LEFT) > > Quitter(root).pack(side=RIGHT) > root.mainloop() > [/CODE] > > 1) When run from command prompt as --- > D:\py>python entry.py > it runs nicely. > > 2) If I double-click on either entry.py or entry.pyw file, > > nothing happens (no DOS console window to show any error also). > > Any idea > how should I run this with double-click on icon! > > Thanks, > Vineet. > > > > > > _______________________________________________ > > 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 From mail at timgolden.me.uk Thu Aug 5 11:49:58 2010 From: mail at timgolden.me.uk (Tim Golden) Date: Thu, 05 Aug 2010 10:49:58 +0100 Subject: [python-win32] Wanted: Win32-savvy developers for core Python Message-ID: <4C5A8946.40407@timgolden.me.uk> Please see my blog post on the subject: http://ramblings.timgolden.me.uk/2010/08/05/wanted-win32-savvy-developers-for-core-python/ In short: give us a hand, please. TJG From d_vineet at yahoo.com Thu Aug 5 15:45:17 2010 From: d_vineet at yahoo.com (Vineet Deodhar) Date: Thu, 5 Aug 2010 06:45:17 -0700 (PDT) Subject: [python-win32] running py app by doubleclick on Win32 In-Reply-To: Message-ID: <832902.35176.qm@web32007.mail.mud.yahoo.com> Dear all, As you all suggested, my python installations are messed-up. There are py2.6 and py3.1 ( py3.1 at two different locations) versions installed. Although I have set the PYTHONPATH variable correctly to run py2.6 version, I wonder how the py3.1 takes control while running any py script!!! In my code, I am importing Tkinter (i.e.py 2.6 syntax). When py3.1 encounters Tkinter, it is giving exception and the program execution halts. Anyway, I will uninstall all and reinstall py2.6 (Oh Ma! I need to reinstall all other site-packages like MySQLdb, PyQt, etc.) Then let me again experiment again. Thanks, Vineet --------------------------------------------------------------------------------- --- On Thu, 5/8/10, python-win32-request at python.org wrote: From: python-win32-request at python.org Subject: python-win32 Digest, Vol 89, Issue 3 To: python-win32 at python.org Date: Thursday, 5 August, 2010, 15:30 Send python-win32 mailing list submissions to ??? python-win32 at python.org To subscribe or unsubscribe via the World Wide Web, visit ??? http://mail.python.org/mailman/listinfo/python-win32 or, via email, send a message with subject or body 'help' to ??? python-win32-request at python.org You can reach the person managing the list at ??? python-win32-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of python-win32 digest..." Today's Topics: ???1. Re: running a python script on WinXP by??? icon??? double-clicking. ? ? ? (Tim Roberts) ???2. Re: running a python script on WinXP by icon??? double-clicking. ? ? ? (Gelonida) ???3. Wanted: Win32-savvy developers for core Python (Tim Golden) ---------------------------------------------------------------------- Message: 1 Date: Wed, 4 Aug 2010 09:56:21 -0700 From: Tim Roberts To: Python-Win32 List Subject: Re: [python-win32] running a python script on WinXP by??? icon ??? double-clicking. Message-ID: <4C599BB5.7050802 at probo.com> Content-Type: text/plain; charset="ISO-8859-1" Vineet Deodhar wrote: > I have created a py2.6 script for a simple GUI with Tkinter. > Saved it with .py extension and also as .pyw extension. > ... > 1) When run from command prompt as --- > D:\py>python entry.py > it runs nicely. > > 2) If I double-click on either entry.py or entry.pyw file, > nothing happens (no DOS console window to show any error also). > > Any idea how should I run this with double-click on icon! > > Does it run if you type just the file name?? For example: ? ? D:\py>entry.py or ? ? D:\py>entry.pyw If it runs like that, then it should run from a double-click.? Do you have multiple versions of Python installed?? Is "Quitter.py" in the same directory as the script?? Can you check the associations from a command line using the assoc and ftype commands, like this: C:\tmp>assoc .py .py=Python.File C:\tmp>assoc .pyw .pyw=Python.NoConFile C:\tmp>ftype python.file python.file="C:\Apps\Python26\python.exe" "%1" %* C:\tmp>ftype python.noconfile python.noconfile="C:\Apps\Python26\pythonw.exe" "%1" %* Your path will probably be different, but the philosophy should be the same. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. ------------------------------ Message: 2 Date: Thu, 05 Aug 2010 09:04:58 +0200 From: Gelonida To: python-win32 at python.org Subject: Re: [python-win32] running a python script on WinXP by icon ??? double-clicking. Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Hi Vineet, Could you please post the output of the ftype and the assoc commands? As Tim asked in his post: Could you try to start the script from a command prompt without the preceding python command? So instead of typing: python entry.py just type entry.py tell us what happens On 08/04/2010 10:02 AM, Vineet Deodhar wrote: > Hi Kevin, > I checked "Opens with" option for .py and .pyw files. > Associations are correct. > > This problem happens for any python script file, not just this-one. > Do I really need to remove & reinstall py26, or can there any other option ! > > ---Vineet. > > > > --- On Wed, 4/8/10, Kevin Horn wrote: > > From: Kevin Horn > Subject: Re: [python-win32] running a python script on WinXP by icon? double-clicking. > To: "Vineet Deodhar" > Date: Wednesday, 4 August, 2010, 12:11 > > First check that .py or .pyw files are associated with the proper executables. > > from an explorer window, choose Tools -> Folder Options > then click on the file types tab > > find the PY and PYW entries in the list, and make sure their "Opens with" entries are correct > > > PY -> python.exe > PY -> pythonw.exe > > If those are correct, and you still have problems, then perhaps your python installation is messed up somehow, > or there's something really strange about your script. > > > Hope this helps, > Kevin Horn > > On Wed, Aug 4, 2010 at 1:30 AM, Vineet Deodhar wrote: > > I have created a py2.6 script for a simple GUI with Tkinter. > Saved it with .py extension and also as .pyw extension. > > > filename is entry.py > [CODE] > from Tkinter import * > from quitter import Quitter > > def fetch(): >? ???print('Input => "%s"' % ent.get()) > > root = Tk() > ent = Entry(root) > ent.show='@' > > ent.insert(0, 'Type words here') > ent.pack(side=TOP, fill=X) > > ent.focus() > ent.bind('', (lambda event: fetch())) > btn = Button(root, text='Fetch', command=fetch) > btn.pack(side=LEFT) > > Quitter(root).pack(side=RIGHT) > root.mainloop() > [/CODE] > > 1) When run from command prompt as --- > D:\py>python entry.py > it runs nicely. > > 2) If I double-click on either entry.py or entry.pyw file, > > nothing happens (no DOS console window to show any error also). > > Any idea >? how should I run this with double-click on icon! > > Thanks, > Vineet. > > > > >? ? ??? > _______________________________________________ > > 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 ------------------------------ Message: 3 Date: Thu, 05 Aug 2010 10:49:58 +0100 From: Tim Golden To: Python-Win32 List Subject: [python-win32] Wanted: Win32-savvy developers for core Python Message-ID: <4C5A8946.40407 at timgolden.me.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Please see my blog post on the subject: http://ramblings.timgolden.me.uk/2010/08/05/wanted-win32-savvy-developers-for-core-python/ In short: give us a hand, please. TJG ------------------------------ _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 End of python-win32 Digest, Vol 89, Issue 3 ******************************************* -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.brunel at pragmadev.com Thu Aug 5 16:38:39 2010 From: eric.brunel at pragmadev.com (Eric Brunel) Date: Thu, 5 Aug 2010 16:38:39 +0200 Subject: [python-win32] Filling random paths with gradients via win32ui/win32gui Message-ID: Hi all, I'm trying to do a printing engine for Windows using win32ui and win32gui, and I stumbled on a problem: the graphics to print may contain random paths, that may have to be filled with a gradient. So I browsed the docs and found win32gui.GradientFill, which does gradients indeed, but only seems to work for triangles or rectangles (according to http://msdn.microsoft.com/en-us/library/dd144957(VS.85).aspx). So far so good: filling the bounding rectangle for a path and clipping it to the path contents is basically what I want, so I tried to find a way to set the clipping region to a random path. This is where my problem is: methods or functions to handle the clipping region exist in win32ui and win32gui, and I seem to need a few of both: - Since neither the SelectClipPath function, nor the SelectClipPath method on CDC objects seem to have been made available through pywin32, it seems my only option is to build the clipping region from the current path. - There is indeed a function PathToRegion in win32gui, which seems to do what I want. Problem: it uses handles as its parameters and return values, and I already have a lot of things that use win32ui, and the objects it defines: PyCDC, PyCRgn, and so on? I also need some methods on PyCDC objects that I haven't found in win32gui (namely StartDoc, StartPage, EndPage, EndDoc). - So I searched for a way to convert or copy objects between the 2 representations. I found one for getting the handle for PyCDC objects (GetHandleOutput) and it seems to work indeed: I can do a win32gui.PathToRegion(my_pycdc.GetHandleOutput()), which returns a handle on the region built from the current path, or so I think. - Since I have to pass the region to my_pycdc.SelectClipRgn, which only accepts PyCRgn objects, I now need a way to convert the handle on the region to a PyCRgn. And this is where I'm stuck: I indeed found a conversion function at C++ level (CRgn::FromHandle, http://msdn.microsoft.com/en-us/library/s0w0kk5s.aspx) , but it doesn't seem to be exposed via the Python API. I tried to add a new method to PyCRgn objects allowing to use this method, but got a lot of compilation errors that I couldn't figure out (I'm far from being a Windows programming expert?) and couldn't get anything usable. In the current state of pywin32, is there any way to achieve what I'm trying to do? If not, can anybody help me adding my method to the PyCRgn object? It's basically a clone of CopyRgn using CRgn::FromHandle instead of PyCRgn::GetRgn to get the region to copy. Thanks! - Eric - From stef.mientki at gmail.com Fri Aug 6 13:27:31 2010 From: stef.mientki at gmail.com (Stef Mientki) Date: Fri, 06 Aug 2010 13:27:31 +0200 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? Message-ID: <4C5BF1A3.8070005@gmail.com> hello, I wonder if there's a fast way to test if a process is running. these are my experiences till so far: 1. win32pdh, not usefull, because it shows ths status of some ancient history 2. wmi, VERY SLOW: 1500 .. 2000 msec import wmi w = wmi.WMI() processes = w.instances('Win32_Process') instances = [] for process in processes : if process.Name.lower() == name : return process.ProcessId 3. Autoit, very fast: 10..20 msec autoit = win32com.client.Dispatch ( "AutoItX3.Control" ) print autoit.ProcessExists ( process ) Are the better (faster) ways, without the use of AutoIt ? Now this raises another question (please forgive my ignorance): Why not use AutoIt always, instead of all the win32 libraries ? AFAIK, the advantages of AutoIt: - seems to be very fast - is very well documented - can be tested in a AutoIt friendly editor (Scite) AFAIK the disadvantages: - when distributing, you must add an extra file thanks, Stef Mientki From mail at timgolden.me.uk Fri Aug 6 13:44:07 2010 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 06 Aug 2010 12:44:07 +0100 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5BF1A3.8070005@gmail.com> References: <4C5BF1A3.8070005@gmail.com> Message-ID: <4C5BF587.9070403@timgolden.me.uk> On 06/08/2010 12:27, Stef Mientki wrote: > hello, > > I wonder if there's a fast way to test if a process is running. > > these are my experiences till so far: > > 1. win32pdh, not usefull, because it shows ths status of some ancient history > > 2. wmi, VERY SLOW: 1500 .. 2000 msec > import wmi > w = wmi.WMI() > processes = w.instances('Win32_Process') > instances = [] > for process in processes : > if process.Name.lower() == name : > return process.ProcessId > > 3. Autoit, very fast: 10..20 msec > autoit = win32com.client.Dispatch ( "AutoItX3.Control" ) > print autoit.ProcessExists ( process ) > > Are the better (faster) ways, without the use of AutoIt ? > > Now this raises another question (please forgive my ignorance): > Why not use AutoIt always, instead of all the win32 libraries ? > AFAIK, the advantages of AutoIt: > - seems to be very fast > - is very well documented > - can be tested in a AutoIt friendly editor (Scite) > AFAIK the disadvantages: > - when distributing, you must add an extra file Try psutil (which uses the toolhelp DLL): http://code.google.com/p/psutil/ import psutil for p in psutil.process_iter (): if p.name == "blah": print p break else: print "Not found" TJG From stef.mientki at gmail.com Fri Aug 6 15:27:24 2010 From: stef.mientki at gmail.com (Stef Mientki) Date: Fri, 06 Aug 2010 15:27:24 +0200 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5BF587.9070403@timgolden.me.uk> References: <4C5BF1A3.8070005@gmail.com> <4C5BF587.9070403@timgolden.me.uk> Message-ID: <4C5C0DBC.9080003@gmail.com> thanks Tim, On 06-08-2010 13:44, Tim Golden wrote: > On 06/08/2010 12:27, Stef Mientki wrote: > Try psutil (which uses the toolhelp DLL): > > http://code.google.com/p/psutil/ > > > import psutil > > for p in psutil.process_iter (): > if p.name == "blah": > print p > break > else: > print "Not found" > > > yes that works quit well, just a little bit slower than AutoIt: AutoIt: 0 .. 15 msec psutils: 40 ..50 msec thanks, Stef Mientki > TJG > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 From sharpblade1 at gmail.com Fri Aug 6 15:37:15 2010 From: sharpblade1 at gmail.com (sharpblade) Date: Fri, 6 Aug 2010 14:37:15 +0100 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5C0DBC.9080003@gmail.com> References: <4C5BF1A3.8070005@gmail.com> <4C5BF587.9070403@timgolden.me.uk> <4C5C0DBC.9080003@gmail.com> Message-ID: You are not using the WMI efficiently. You iterate over every process to test if only one is there, when you can use WMI like so: >>> import wmi >>> x = wmi.WMI() >>> x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") [<_wmi_object: \\TOM-PC\root\cimv2:Win32_Process.Handle="7052">] >>> def test(): t1 = time.time() x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") print time.time()-t1 >>> import time >>> test() 0.0829999446869 >>> You can further reduce load times by requesting less data from WMI, i.e stuff you are going to use: >>> def test(): t1 = time.time() x.query("SELECT Handle FROM Win32_Process WHERE Name = 'xchat.exe'") print time.time()-t1 >>> test() 0.0599999427795 On Fri, Aug 6, 2010 at 2:27 PM, Stef Mientki wrote: > thanks Tim, > > On 06-08-2010 13:44, Tim Golden wrote: > > On 06/08/2010 12:27, Stef Mientki wrote: > > > > Try psutil (which uses the toolhelp DLL): > > > > http://code.google.com/p/psutil/ > > > > > > import psutil > > > > for p in psutil.process_iter (): > > if p.name == "blah": > > print p > > break > > else: > > print "Not found" > > > > > > > yes that works quit well, just a little bit slower than AutoIt: > AutoIt: 0 .. 15 msec > psutils: 40 ..50 msec > > thanks, > Stef Mientki > > TJG > > _______________________________________________ > > 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 stef.mientki at gmail.com Fri Aug 6 21:10:02 2010 From: stef.mientki at gmail.com (Stef Mientki) Date: Fri, 06 Aug 2010 21:10:02 +0200 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: References: <4C5BF1A3.8070005@gmail.com> <4C5BF587.9070403@timgolden.me.uk> <4C5C0DBC.9080003@gmail.com> Message-ID: <4C5C5E0A.3010205@gmail.com> thanks, On 06-08-2010 15:37, sharpblade wrote: > You are not using the WMI efficiently. You iterate over every process to test if only one is > there, when you can use WMI like so: > > >>> import wmi > >>> x = wmi.WMI() > >>> x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") > [<_wmi_object: \\TOM-PC\root\cimv2:Win32_Process.Handle="7052">] > >>> def test(): > t1 = time.time() > x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") > print time.time()-t1 > > >>> import time > >>> test() > 0.0829999446869 > >>> > but that looks quit more complicated than psutils, besides that I believe that psutils is platform independant. cheers, Stef -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at timgolden.me.uk Fri Aug 6 21:18:49 2010 From: mail at timgolden.me.uk (Tim Golden) Date: Fri, 06 Aug 2010 20:18:49 +0100 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5C5E0A.3010205@gmail.com> References: <4C5BF1A3.8070005@gmail.com> <4C5BF587.9070403@timgolden.me.uk> <4C5C0DBC.9080003@gmail.com> <4C5C5E0A.3010205@gmail.com> Message-ID: <4C5C6019.8040808@timgolden.me.uk> On 06/08/2010 8:10 PM, Stef Mientki wrote: > thanks, > > On 06-08-2010 15:37, sharpblade wrote: >> You are not using the WMI efficiently. You iterate over every process to test if only one is >> there, when you can use WMI like so: >> >>>>> import wmi >>>>> x = wmi.WMI() >>>>> x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") >> [<_wmi_object: \\TOM-PC\root\cimv2:Win32_Process.Handle="7052">] >>>>> def test(): >> t1 = time.time() >> x.query("SELECT * FROM Win32_Process WHERE Name = 'xchat.exe'") >> print time.time()-t1 >> >>>>> import time >>>>> test() >> 0.0829999446869 >>>>> >> > but that looks quit more complicated than psutils, > besides that I believe that psutils is platform independant. Well, just to phrase is slightly differently: import wmi c = wmi.WMI () for p in c.Win32_Process (Name="xchat.exe"): print p break else: print "Not found" TJG From stef.mientki at gmail.com Sat Aug 7 00:34:55 2010 From: stef.mientki at gmail.com (Stef Mientki) Date: Sat, 07 Aug 2010 00:34:55 +0200 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5C6019.8040808@timgolden.me.uk> References: <4C5BF1A3.8070005@gmail.com> <4C5BF587.9070403@timgolden.me.uk> <4C5C0DBC.9080003@gmail.com> <4C5C5E0A.3010205@gmail.com> <4C5C6019.8040808@timgolden.me.uk> Message-ID: <4C5C8E0F.8070600@gmail.com> thanks Tim, On 06-08-2010 21:18, Tim Golden wrote: >> but that looks quit more complicated than psutils, >> besides that I believe that psutils is platform independant. > 0.0829999446869 > > Well, just to phrase is slightly differently: > > > import wmi > > c = wmi.WMI () > for p in c.Win32_Process (Name="xchat.exe"): > print p > break > else: > print "Not found" > > > that looks much better, but still windows only ;-) cheers, Stef > TJG > From RDahlstrom at directedge.com Sat Aug 7 01:00:32 2010 From: RDahlstrom at directedge.com (Dahlstrom, Roger) Date: Fri, 6 Aug 2010 19:00:32 -0400 Subject: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? In-Reply-To: <4C5C8E0F.8070600@gmail.com> Message-ID: <78C91C6FD63DD04BB8812EE9288C1E812678B30A46@EXCHANGE01.office.directedge.net> Python-Win32... As in win32 As in windows... :-) ----- Original Message ----- From: python-win32-bounces+rdahlstrom=directedge.com at python.org Cc: python-win32 at python.org Sent: Fri Aug 06 18:34:55 2010 Subject: Re: [python-win32] fast test if (unknown) process is running ? Why not use Autoit ? thanks Tim, On 06-08-2010 21:18, Tim Golden wrote: >> but that looks quit more complicated than psutils, >> besides that I believe that psutils is platform independant. > 0.0829999446869 > > Well, just to phrase is slightly differently: > > > import wmi > > c = wmi.WMI () > for p in c.Win32_Process (Name="xchat.exe"): > print p > break > else: > print "Not found" > > > that looks much better, but still windows only ;-) cheers, Stef > TJG > _______________________________________________ python-win32 mailing list python-win32 at python.org http://mail.python.org/mailman/listinfo/python-win32 DISCLAIMER: This e-mail, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any e-mail and any printout thereof. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. Direct Edge may, at its discretion, monitor and review the content of all e-mail communications. From smokefloat at gmail.com Sat Aug 7 05:11:39 2010 From: smokefloat at gmail.com (David Hutto) Date: Fri, 6 Aug 2010 23:11:39 -0400 Subject: [python-win32] Compiling python functions in a c file on windows Message-ID: While trying to go through the tutorial in the official python documentation, I'm encountering a problem on Windows(ubuntu/linux compiles the same test file fine) I'm just using a 'dummy' function at this point, so no other errors are thrown: #include "c:\\Python31\\include\\Python.h" int main() { } When compiling the test file on Visual C++ 2008/9.0 Express it shows the error: LINK : fatal error LNK1104: cannot open file 'python31_d.lib' I know that this is the debug lib for my version of python on windows. I've built the current source tarball, but it seems that it is two versions down(the one available for install is r312:79149, and the tarball is r312:79147, which builds the pythoncore fine in debug, but not in release). So I have the debug(python31_d.lib), for the tarball version, but not the first. Compiling python/c on windows is not as easy, when compared to ubuntu, although I'm sure it's something minor I'm missing(last time was a toggle box that took me two days to figure out wasn't checked). So, before I go on a testing rant, do I need to build the debug pythoncore from the currently used version, not the tarball, or does it matter(I'm guessing so, because of the syntax error, and a million unknown character errors I get when trying to use the two down version on the tarball)?. This is just to see if their is an easier way(or something simpler than I thought) to do this. If not, then on to svn checkout. It seems as though ubuntu would want the python debug file too(however I have downloaded several packages related to python development that may have contained this necessary requirement). TIA, David From metolone+gmane at gmail.com Sat Aug 7 09:13:32 2010 From: metolone+gmane at gmail.com (Mark Tolonen) Date: Sat, 7 Aug 2010 00:13:32 -0700 Subject: [python-win32] Compiling python functions in a c file on windows References: Message-ID: "David Hutto" wrote in message news:AANLkTinKVsK60swwvFp-P30OTvCLiAeRqO7j_XgaWVn7 at mail.gmail.com... > While trying to go through the tutorial in the official python > documentation, I'm encountering a problem on Windows(ubuntu/linux > compiles the same test file fine) > > I'm just using a 'dummy' function at this point, so no other errors are > thrown: > > #include "c:\\Python31\\include\\Python.h" > > int main() { > > } > > > When compiling the test file on Visual C++ 2008/9.0 Express it shows the > error: > > LINK : fatal error LNK1104: cannot open file 'python31_d.lib' > > I know that this is the debug lib for my version of python on windows. > I've built the current source tarball, but it seems that it is two > versions down(the one available for install is r312:79149, and the > tarball is r312:79147, which builds the pythoncore fine in debug, but > not in release). > So I have the debug(python31_d.lib), for the tarball version, but not the > first. > > Compiling python/c on windows is not as easy, when compared to ubuntu, > although I'm sure it's something minor I'm missing(last time was a > toggle box that took me two days to figure out wasn't checked). > > So, before I go on a testing rant, do I need to build the debug > pythoncore from the currently used version, not the tarball, or does > it matter(I'm guessing so, because of the syntax error, and a million > unknown character errors I get when trying to use the two down version > on the tarball)?. > > This is just to see if their is an easier way(or something simpler > than I thought) to do this. If not, then on to svn checkout. > > It seems as though ubuntu would want the python debug file too(however > I have downloaded several packages related to python development that > may have contained this necessary requirement). Is the directory containing python31_d.lib in the linker's search path? If you add the python include and lib paths to the following dialog (VS2008-specific): Tools, Options, Projects and Solutions, VC++ Directories Show directories for: Include Files Show directories for: Library Files This makes them available to any project without hard-coding paths in source code or project settings. Alternatively, hard-code the paths in the project's properties: Project, Properties, Configuration Properties, C/C++, General, Additional Include Directories Project, Properties, Configuration Properties, Linker, General, Additional Library Directories In both cases, make sure both Debug and Release builds have the paths set correctly. -Mark From smokefloat at gmail.com Sat Aug 7 14:32:32 2010 From: smokefloat at gmail.com (David Hutto) Date: Sat, 7 Aug 2010 08:32:32 -0400 Subject: [python-win32] Compiling python functions in a c file on windows In-Reply-To: References: Message-ID: On Fri, Aug 6, 2010 at 11:11 PM, David Hutto wrote: > While trying to go through the tutorial in the official python > documentation, I'm encountering a problem on Windows(ubuntu/linux > compiles the same test file fine) > > I'm just using a 'dummy' function at this point, so no other errors are thrown: > > #include "c:\\Python31\\include\\Python.h" > > int main() { > > } > > > When compiling the test file on Visual C++ 2008/9.0 Express it shows the error: > > LINK : fatal error LNK1104: cannot open file 'python31_d.lib' > > I know that this is the debug lib for my version of python on windows. > I've built the current source tarball, but it seems that it is two > versions down(the one available for install is r312:79149, and the > tarball is r312:79147, which builds the pythoncore fine in debug, but > not in release). > So I have the debug(python31_d.lib), for the tarball version, but not the first. > > Compiling python/c on windows is not as easy, when compared to ubuntu, > although I'm sure it's something minor I'm missing(last time was a > toggle box that took me two days to figure out wasn't checked). > > So, before I go on a testing rant, do I need to build the debug > pythoncore from the currently used version, not the tarball, or does > it matter(I'm guessing so, because of the syntax error, and a million > unknown character errors I get when trying to use the two down version > on the tarball)?. > > This is just to see if their is an easier way(or something simpler > than I thought) to do this. If not, then on to svn checkout. > > It seems as though ubuntu would want the python debug file too(however > I have downloaded several packages related to python development that > may have contained this necessary requirement). > > TIA, > David > This is not correction, but stands upon. The shoulders of giants, and you know your defiance, it is your defiance From mc at mclaveau.com Sun Aug 8 22:07:39 2010 From: mc at mclaveau.com (Michel Claveau) Date: Sun, 8 Aug 2010 22:07:39 +0200 Subject: [python-win32] RAM with Pywin32 on Windows-64 Message-ID: <84D1C7F07E8E488FA08513C5346546BC@MCI1330> Hi, all! I have a script, in Pywin32, with a leak memory. OK, it is my bug (a problem for me, not for you). But I seen a bizar trick... When I run the script in Windows 7-32 bits, the "bug" is showed at 2 GB crunched (OK, 2 GB is the max for a process) When I run the script in Windows 7-64 bits, the "bug" is showed at 4 GB crunched, on a computer with 8 GB. Why 4 GB, and no 2 GB or 8 GB? Sorry for my bad english, and good night. -- Michel Claveau From chef at ghum.de Sun Aug 8 22:47:16 2010 From: chef at ghum.de (Massa, Harald Armin) Date: Sun, 8 Aug 2010 22:47:16 +0200 Subject: [python-win32] RAM with Pywin32 on Windows-64 In-Reply-To: <84D1C7F07E8E488FA08513C5346546BC@MCI1330> References: <84D1C7F07E8E488FA08513C5346546BC@MCI1330> Message-ID: Michael, I did a quick google for available memory per process win32 on win64 http://www.google.de/search?q=available+memory+per+process+win32+on+win64&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:unofficial&client=firefox-a and my first hit is: http://msdn.microsoft.com/en-us/library/aa366778%28VS.85%29.aspx there I read: User-mode virtual address space for each 32-bit process limit in 32-bit windows: 2 GB Up to 3 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE and 4GT limit in 64-bit windows: 2 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE cleared (default) 4 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE set so, I guess your IMAGE_FILE_LARGE_ADDRESS_AWARE ist set on your 64bit machine, which explains the 4Gig. Best wishes, Harald On Sun, Aug 8, 2010 at 22:07, Michel Claveau wrote: > Hi, all! > > I have a script, in Pywin32, with a leak memory. > OK, it is my bug (a problem for me, not for you). > > But I seen a bizar trick... > > When I run the script in Windows 7-32 bits, the "bug" is showed at 2 GB > crunched ?(OK, 2 GB is the max for a process) > When I run the script in Windows 7-64 bits, the "bug" is showed at 4 GB > crunched, on a computer with 8 GB. > > Why 4 GB, and no 2 GB or 8 GB? > > > Sorry for my bad english, and good night. > > -- > Michel Claveau > > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > http://mail.python.org/mailman/listinfo/python-win32 > -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 no fx, no carrier pigeon - Using PostgreSQL is mostly about sleeping well at night. From smokefloat at gmail.com Mon Aug 9 09:37:58 2010 From: smokefloat at gmail.com (David Hutto) Date: Mon, 9 Aug 2010 03:37:58 -0400 Subject: [python-win32] Compiling python functions in a c file on windows In-Reply-To: References: Message-ID: On Sat, Aug 7, 2010 at 8:32 AM, David Hutto wrote: > On Fri, Aug 6, 2010 at 11:11 PM, David Hutto wrote: >> While trying to go through the tutorial in the official python >> documentation, I'm encountering a problem on Windows(ubuntu/linux >> compiles the same test file fine) >> >> I'm just using a 'dummy' function at this point, so no other errors are thrown: >> >> #include "c:\\Python31\\include\\Python.h" >> >> int main() { >> >> } >> >> >> When compiling the test file on Visual C++ 2008/9.0 Express it shows the error: >> >> LINK : fatal error LNK1104: cannot open file 'python31_d.lib' >> >> I know that this is the debug lib for my version of python on windows. >> I've built the current source tarball, but it seems that it is two >> versions down(the one available for install is r312:79149, and the >> tarball is r312:79147, which builds the pythoncore fine in debug, but >> not in release). >> So I have the debug(python31_d.lib), for the tarball version, but not the first. >> >> Compiling python/c on windows is not as easy, when compared to ubuntu, >> although I'm sure it's something minor I'm missing(last time was a >> toggle box that took me two days to figure out wasn't checked). >> >> So, before I go on a testing rant, do I need to build the debug >> pythoncore from the currently used version, not the tarball, or does >> it matter(I'm guessing so, because of the syntax error, and a million >> unknown character errors I get when trying to use the two down version >> on the tarball)?. >> >> This is just to see if their is an easier way(or something simpler >> than I thought) to do this. If not, then on to svn checkout. >> >> It seems as though ubuntu would want the python debug file too(however >> I have downloaded several packages related to python development that >> may have contained this necessary requirement). >> >> TIA, >> David >> > > This is not correction, but stands upon. > The shoulders of giants, and you know your defiance, > it is your defiance > Ignore this, I was writing a story in another text editor, while drinking and got confused apparently. Drunk newb said what? From mail at timgolden.me.uk Mon Aug 9 10:28:04 2010 From: mail at timgolden.me.uk (Tim Golden) Date: Mon, 09 Aug 2010 09:28:04 +0100 Subject: [python-win32] Wanted: subprocess horror stories Message-ID: <4C5FBC14.5090203@timgolden.me.uk> I'm doing some work on the Windows-specific bit of the subprocess model. In particular, the quoting requirements of strings getting passed to the COMSPEC shell, but anything else which crops up. To start with I've committed patches originally worked up by Gabriel Genellina but there's more to do there especially as regards embedded quotes etc. So... I'd like to hear about the hoops you've had to jump through to get subprocess.Popen/call working with awkward strings, spaces, quotes, redirections, special characters, unicode filenames. Whatever. I'll then add them into the test cases as I build. I'm targetting 3.2 but willing to port to 3.1 & 2.7 TJG From Marc-Andre.Belzile at autodesk.com Tue Aug 10 21:38:05 2010 From: Marc-Andre.Belzile at autodesk.com (Marc-Andre Belzile) Date: Tue, 10 Aug 2010 12:38:05 -0700 Subject: [python-win32] SystemError: Parent module '__ax_main__' not loaded Message-ID: Hi, I'm using the Python ActiveX Scripting engine and I'm trying to set some global variables in the engine global space before parsing some .py files. I use this function to set the variables: def set_global_vars(fullpath ): import os globals()['__path__'] = os.path.dirname( fullpath ) globals()['__file__'] = fullpath It seems to work with my python installation (py2.6/pywin 212) but some customers of mine have reported an error with this line below (using a similar installation) from win32com.client import dynamic as D # ERROR : Traceback (most recent call last): # File "