Re: [python-win32] Passing c structure into Python script

2009-11-19 Thread Gerdus van Zyl
Never done it myself but I would suggest writing the c struct to a temp file. Then call the python script using normal system call in C (http://en.wikipedia.org/wiki/System_%28C_standard_library%29) and read the temp file using struct module from python http://docs.python.org/library/struct.html

Re: [python-win32] vb6 calling python script

2009-10-26 Thread Gerdus van Zyl
You can just use Shell or AdvShell[1] to run python.exe and the script name as parameter; If you have the associations that the python installer setups you might just be able to use just the script name. ~Gerdus http://www.freevbcode.com/ShowCode.Asp?ID=1282 On Mon, Oct 26, 2009 at 4:38 PM, Fred

Re: [python-win32] Windows 7 taskbar api

2009-09-28 Thread Gerdus van Zyl
>You would probably rename the >comtypes.gen._683BF642_E9CA_4124_BE43_67065B2FA653_0_1_0 >to something more sensible > Creating an instance would be easier if you use code like > this which uses the _reg_clsid_ attribute from the generated CoClass:> > from win7taskbar import ITaskbarList3, Taskbar

Re: [python-win32] Windows 7 taskbar api

2009-09-27 Thread Gerdus van Zyl
oblem since I would have to ship the generated interface if I decide to use this code. Anyway usage is then straightforward: taskbar.HrInit() taskbar.SetProgressValue(hWnd,25,100) Anyway I'm guessing/hoping there will be Windows 7 support in a future version of win32com :-) ~G On Thu, Sep 2

[python-win32] Windows 7 taskbar api

2009-09-24 Thread Gerdus van Zyl
Hi, Has anybody played with the win7 taskbar api? I just love the taskbar progress bar and would like it in my little app. But since win7 isn't even commercially available (i got mine from msdn) samples are scarce. Working from some pascal examples /vb.net interop examples /msdn docs I made the f

Re: [python-win32] Find IP address for a UNC path

2009-08-27 Thread Gerdus van Zyl
I would say try socket.gethostbyname; http://docs.python.org/library/socket.html#socket.gethostbyname On Thu, Aug 27, 2009 at 2:59 PM, Dahlstrom, Roger wrote: > Ping it and get the address. > > -Original Message- > From: python-win32-bounces+rdahlstrom=directedge@python.org > [mailto

Re: [python-win32] Immediately disconnecting a socket in Windows

2009-08-14 Thread Gerdus van Zyl
Do you set a socket timeout value via socket.setdefaulttimeout? see: http://www.python.org/doc/2.6/library/socket.html#socket.setdefaulttimeout ~Gerdus On Thu, Aug 13, 2009 at 7:17 PM, Marte Soliza wrote: > I'm using httplib as an HTTP client for a custom HTTP server. One thing I > need is to be

Re: [python-win32] determining information about a window

2009-08-09 Thread Gerdus van Zyl
Have you tried Spy++ I think it's part of the windows SDK tools. On Sun, Aug 9, 2009 at 6:09 PM, Eric Blade wrote: > This is kind of a weird question - I have a process that has two > windows with the exact same name.  I need to figure out some way to > differentiate between the two windows - what

Re: [python-win32] Why can I compile a C extension if I replace python25.lib with python25.dll?

2009-08-07 Thread Gerdus van Zyl
See this page: http://eli.thegreenplace.net/2008/06/28/compiling-python-extensions-with-distutils-and-mingw/ it has helped me with something similar and tells how to make a mingw compatable libpython25.a; In newer mingw version I think it can figure out the exports (the .a) from the dll itself. ~

Re: [python-win32] MSHTML wrapper class and example using IWebBrowser2

2009-08-03 Thread Gerdus van Zyl
very nice! I was looking at pyjd a while back but didn't like the gtk dependency. Any posibility on porting hulahop to windows? ~Gerdus On Mon, Aug 3, 2009 at 12:22 AM, lkcl wrote: > > hi there, > > from about a dozen different sources i've managed to put together something > similar to the old c

Re: [python-win32] Copying a MS Access Table

2009-07-29 Thread Gerdus van Zyl
Are you trying to copy a table from an access database to a postgres database? Because that's the impression I get, in which case do you need to do it once or do you need to do it regularly? In both cases Python might not be an optimal choice. You might have more luck using TransferDatabase and ODB

Re: [python-win32] regarding invoking command prompt using python

2009-06-17 Thread Gerdus van Zyl
1) filename = "C:/Program Files (x86)/NSIS/makensisw.exe" doc = "install.nsi" status = os.system('""%s" "%s"' % (filename, doc)) print "Status: ", status If you have long running program you want the output from there are other options but the above is easiest imho. 2) just open the python file u

Re: [python-win32] Phyton editor

2009-06-04 Thread Gerdus van Zyl
My favourites are in order of preference: nbPython - http://wiki.netbeans.org/Python (get a latest development build) pydev - http://pydev.sourceforge.net/ ~Gerdus ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/list

Re: [python-win32] Problem in install Distutils/python-sybase-0.39

2009-06-02 Thread Gerdus van Zyl
. > Now its another problem. > santosh-r4c:~/python-sybase-0.39/python-sybase-0.39 # python setup.py > install > Directory /root/python-sybase-0.39/python-sybase-0.39/include does not exist > - cannot build. > > CAn you help me! > > Thanks, > Santosh > > On Mon

Re: [python-win32] Problem in install Distutils/python-sybase-0.39

2009-06-01 Thread Gerdus van Zyl
Ok try installing the python-devel package. On Mon, Jun 1, 2009 at 1:13 PM, Santosh Mohan wrote: > Python is the same of SLES10 distro > > santosh-r4c:~ # python -V > Python 2.4.2 > > > On Mon, Jun 1, 2009 at 3:28 PM, Gerdus van Zyl > wrote: >> >> what pyth

Re: [python-win32] Problem in install Distutils/python-sybase-0.39

2009-06-01 Thread Gerdus van Zyl
what python version are you running? and from where did you get python? distutils should be part of your python since it's part of the standard library. On Mon, Jun 1, 2009 at 11:43 AM, Santosh Mohan wrote: > Hi, > > I am facing problem in installing python-sybase-0.39 and Distutils. > > python-s

Re: [python-win32] Vista64 Jet

2009-05-13 Thread Gerdus van Zyl
Ah, ok. Thank you. On Thu, May 14, 2009 at 12:24 AM, Mark Hammond wrote: > On 11/05/2009 11:16 PM, Gerdus van Zyl wrote: > > I got the same error in visual studio and the solution is to set >> compilation to 32bit since jet does not exist for vista-64bit. I have >> pyth

[python-win32] Vista64 Jet

2009-05-11 Thread Gerdus van Zyl
The following code: conn = win32com.client.Dispatch(r'ADODB.Connection') DSN = 'PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=%s;Jet OLEDB:Database Password=root' % dbName conn.Open(DSN) gives: com_error: (-2147352567, 'Exception occurred.', (0, u'ADODB.Connection', u'Provider cannot be found. It

Re: [python-win32] Modify only the first line of a big file (Roughly 1.5MB - For thousands of file).

2009-05-03 Thread Gerdus van Zyl
It seems it's not possible if as mentioned you aren't replacing a line with a line of the same lenght/bytes. You then have to resort to using intermediate files see: http://python.pastebin.com/f539b4e46 On Sun, May 3, 2009 at 1:01 PM, Robert wrote: > Khalid Moulfi wrote: >> >> Hi all, >>  I have

Re: [python-win32] Welcome to the "python-win32" mailing list

2009-04-05 Thread Gerdus van Zyl
Firstly there is no module called win32; only things like win32api or win32gui, etc. (May have changed in py3k version?) Otherwise check your python path in pydev: Go Window -> Preferences -> Pydev -> Interpreter - Python On my system there is an entry for c:\python25\lib\site-packages\win32; if

Re: [python-win32] Might be a easy problem.

2009-04-05 Thread Gerdus van Zyl
see http://rafb.net/p/7WVngC64.html I modified it till it worked and fixed some style issues. As suggested there are many excellent python tutorials available which may be of use. On Sun, Apr 5, 2009 at 4:13 AM, DynamicBit wrote: > Hi! > > Got this problem, > > http://rafb.net/p/Ra3GRf40.html > >

Re: [python-win32] opening files with names in non-english characters.

2009-02-23 Thread Gerdus van Zyl
mory. > Thanks for your suggestions, > Venu > On Tue, Feb 24, 2009 at 12:49 PM, Gerdus van Zyl > wrote: >> >> I see a couple of problems with your code: >> >> 1. where is n first given a value and what is it total file count, >> etc? also you decremen

Re: [python-win32] opening files with names in non-english characters.

2009-02-23 Thread Gerdus van Zyl
I see a couple of problems with your code: 1. where is n first given a value and what is it total file count, etc? also you decrement the value, do you want the last file in the directory or something? 2. The if os.path.isdir(full_path): .. findFile(full_path) part doesn't return or handle the val

Re: [python-win32] Help required in opening a remote file in python.

2009-02-22 Thread Gerdus van Zyl
Try using the normal file access functions, eg: open("file","r"), etc. ~G On Mon, Feb 23, 2009 at 6:14 AM, venu madhav wrote: > Hello all, I am writing an application where I need to open a shared file on > a remote machine using python script. I tried using the following function: > f = urllib.

Re: [python-win32] How to make python scripts output to current cmd window? (like linux terminal)

2008-11-16 Thread Gerdus van Zyl
Try removing it from PATHEXT, it seems to work fine without just going on the file association. At least on my PC. ~Gerdus On Sun, Nov 16, 2008 at 8:04 PM, sayeo87 <[EMAIL PROTECTED]> wrote: > > Right now on Windows I have added ".py" to my PATHEXT so that I can run .py > files by doing ./.py. Bu

Re: [python-win32] Play MP3s from Windows, Just Works

2008-08-12 Thread Gerdus van Zyl
Try pyglet [pyglet.org]. It wraps avbin for mp3,ogg reading and plays using directsound, alsa, etc. Not sure if it could be made easy_installable. ~Gerdus On Tue, Aug 12, 2008 at 8:14 AM, Michael Gundlach <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to play an MP3 from Python 2.5 in Window

Re: [python-win32] class and modules

2008-07-26 Thread Gerdus van Zyl
Wel firstly it won't work, the class should be: class a(object): def b(self): print "b" def c(self): print "c" so to call b you first need instance of object: myA = a() myA.b() I am not really understanding what you wish to achieve. Also you say "I went thru the notes.", w

Re: [python-win32] P3K?

2008-06-23 Thread Gerdus van Zyl
And of course REAL programmers use butterflies. http://xkcd.com/378/ On Mon, Jun 23, 2008 at 12:54 PM, Dahlstrom, Roger <[EMAIL PROTECTED]> wrote: > Well *I* used to line up rocks in to ones and zeros. Then I had a toucan > that would interpret them, and chisel the gui on to a stone tablet. I s

Re: [python-win32] Problems connecting to an MS Access (.mdb) file

2008-06-16 Thread Gerdus van Zyl
>From some googling it seems to be a file permission problem. see http://www.bellaonline.com/articles/art17684.asp and http://support.microsoft.com/?scid=kb%3Ben-us%3B315456 As a workaround you can make a local access database, use link tables to connect to the remote database, then point your scr

Re: [python-win32] Dispatch InternetExplorer.Application fails

2008-05-28 Thread Gerdus van Zyl
Have you seen www.htmltopdf.org? Otherwise might I suggest http://www.openreport.org/; you could then transform your XML into RML(xml reporting format) into a PDF. You can also design RML with OpenOffice. ~Gerdus On Tue, May 27, 2008 at 10:41 PM, Rickey, Kyle W < [EMAIL PROTECTED]> wrote: > Tim

Re: [python-win32] maya and python

2008-05-20 Thread Gerdus van Zyl
Depends on how python is integrated with maya, are there other plugins that use external GUI libraries? You might want to ask a maya list they will know better. On Mon, May 19, 2008 at 8:14 PM, kNish <[EMAIL PROTECTED]> wrote: > I need to call it from inside Maya. > > > > On Mon, May 1

Re: [python-win32] python and soap?

2008-04-11 Thread Gerdus van Zyl
See this blog post: http://www.kunxi.org/archives/2008/01/pythonsoap-second-encounter/ http://pywebsvcs.sourceforge.net/ http://trac.optio.webfactional.com/ The choice depends on your requirements. On Fri, Apr 11, 2008 at 8:58 PM, Sagar Khushalani <[EMAIL PROTECTED]> wrote: > i guess this quest

Re: [python-win32] Idle Event

2008-03-30 Thread Gerdus van Zyl
So to answer my own question: use win32gui.PumpWaitingMessages, it uses peekmessage. so you can then replace PumpMessages() with: while PumpWaitingMessages() == 0: #some idle function or processing here ~gvz On Fri, Mar 28, 2008 at 11:59 AM, Gerdus van Zyl <[EMAIL PROTECTED]> wrote

[python-win32] Idle Event

2008-03-28 Thread Gerdus van Zyl
Hi, How can I run a function when the event loop is idle? It's for animation and some layout calculation. Currently I am doing that using threads but the responsiveness of my application is suffering. Thank you ~Gerdus ___ python-win32 mailing list pyth

Re: [python-win32] message queueing between processes

2008-02-18 Thread Gerdus van Zyl
Try one of these: (in order of my preference) http://datamining.anu.edu.au/~ole/pypar/ http://www.parallelpython.com/ http://www.its.caltech.edu/~astraw/seppo.html http://www-users.cs.york.ac.uk/~aw/pylinda/ They exist on a higher level than pure IPC in that running a master server, spawning clie

Re: [python-win32] Fastest GDI loop

2008-02-08 Thread Gerdus van Zyl
I would say "premature" optimization :-) Was just wondering if there was some standard way to structure a graphics/gdi program. for example: Message maps suck! use XYZ or ABC instead. ~GerdusVZ On Feb 8, 2008 5:35 PM, Larry Bates <[EMAIL PROTECTED]> wrote: > > Gerdus

[python-win32] Fastest GDI loop

2008-02-06 Thread Gerdus van Zyl
don't know what is the best way to do things. Thank You, Gerdus van Zyl from win32api import * try: from winxpgui import * except ImportError: from win32gui import * import win32con import sys, os import cairo import thread import time from random import randint,random from pprint i

Re: [python-win32] Print PDF

2008-02-03 Thread Gerdus van Zyl
ot;)]' % (pd,)) #c.Exec('[FilePrintSilent("%s")]' % (pd,)) s.Destroy() With the above you can open,print,print silent a PDF. I leave it as an exercise to the reader to make the reader window hidden instead if so desired. ~Gerdus van zyl On Feb 3, 2008 1:29 AM, Michel Cl

[python-win32] Print PDF

2008-02-02 Thread Gerdus van Zyl
uot;C:\uxpython\fun\iac.pdf" avdoc.LoadFile(pd) print avdoc.GetVersions() avdoc.printAll() This does not have any effect, as in nothing is printed or displayed but the call to GetVersions does return information. Thanks, Gerdus van Zyl ___ pytho